GithubHelp home page GithubHelp logo

isabella232 / tokudb-backup-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from percona/tokudb-backup-plugin

0.0 0.0 0.0 67 KB

Percona TokuBackup -- moved to Percona Server, but this is kept for the commit history

Home Page: https://www.percona.com/doc/percona-server/LATEST/tokudb/toku_backup.html

License: GNU General Public License v2.0

CMake 5.15% C++ 94.85%

tokudb-backup-plugin's Introduction

The Percona TokuBackup library intercepts system calls that write files and duplicates the writes on backup files. It does this while copying files to the backup directory.

The following technical issues must be addressed to get Percona TokuBackup working with MySQL:

  • The TokuBackup library must be loaded into the mysqld server so that it can intercept system calls. We use LD_PRELOAD to solve the system call intercept problem. Alternatively, the hot backup library can be linked into mysqld.

  • There must be a user interface that can be used to start a backup, track its progress, and determine whether or not the backup succeeded. We use a plugin that kicks off a backup as a side effect of setting a backup session variable to the name of the destination directory.

Installing the Percona TokuBackup libraries

1 Extract the tarball

2 Copy tokudb_backup.so to MySQL's plugin directory

3 Copy libHotBackup.so to MySQL's lib directory

4 Run mysqld with the TokuBackup library (should exist in the lib directory)

LD_PRELOAD=PATH_TO_MYSQL_BASE_DIR/lib/libHotBackup.so mysqld_safe

NOTE: The preload is NOT necessary for MySQL and MariaDB builds from Percona since we link the TokuBackup library into mysqld already.

5 Install the TokuBackup plugin (should exist in the MySQL plugin directory)

install plugin tokudb_backup soname 'tokudb_backup.so';

Running a backup

Backup to the '/tmp/backup1047' directory. This blocks until the backup is complete.

set tokudb_backup_dir='/tmp/backup1047';

The set tokudb_backup_dir statement will succeed if the backup was taken. Otherwise, the tokudb_backup_last_error variable is set.

select @@tokudb_backup_last_error, @@tokudb_backup_last_error_string;

Excluding source files

Lets suppose that you want to exclude all 'lost+found' directories from the backup. The tokudb_backup_exclude session variable contains a regular expression that all source file names are compared with. If the source file name matches the exclude regular expression, then the source file is excluded from the backup.

set tokudb_backup_exclude='/lost\\+found($|/)';
set tokudb_backup_dir='/tmp/backup105';

Monitoring progress

Percona TokuBackup updates the processlist state with progress information while it is running.

Throttling the backup write rate

The tokudb_backup_throttle variable imposes an upper bound on the write rate of the TokuDB backup. Units are bytes per second. Default is no upper bound.

Variables

tokudb_backup_plugin_version

  • name:tokudb_backup_plugin_version
  • readonly:true
  • scope:system
  • type:str
  • comment:version of the TokuBackup plugin

tokudb_backup_version

  • name:tokudb_backup_version
  • readonly:true
  • scope:system
  • type:str
  • comment:version of the TokuBackup library

tokudb_backup_allowed_prefix

  • name:tokudb_backup_allowed_prefix
  • readonly:true
  • scope:system
  • type:str
  • comment:allowed prefix of the destination directory

tokudb_backup_throttle

  • name:tokudb_backup_throttle
  • readonly:false
  • scope:session
  • type:ulonglong
  • def_val:18446744073709551615
  • min_val:0
  • max_val:18446744073709551615
  • comment:backup throttle on write rate in bytes per second

tokudb_backup_dir

  • name:tokudb_backup_dir
  • readonly:false
  • scope:session
  • type:str
  • comment:name of the directory where the backup is stored

tokudb_backup_last_error

  • name:tokudb_backup_last_error
  • readonly:false
  • scope:session
  • type:ulong
  • def_val:0
  • min_val:0
  • max_val:18446744073709551615
  • comment:error from the last backup. 0 is success

tokudb_backup_last_error_string

  • name:tokudb_backup_last_error_string
  • readonly:false
  • scope:session
  • type:str
  • comment:error string of the last backup

tokudb_backup_exclude

  • name:tokudb_backup_exclude
  • readonly:false
  • scope:session
  • type:str
  • comment:exclude source file regular expression

Building the Percona TokuBackup plugin from source

TokuBackup is now part of Percona Server. For information about building Percona Server, refer to the corresponding documentation at https://www.percona.com/doc/percona-server/5.6/installation.html#compiling-percona-server-from-source.

tokudb-backup-plugin's People

Contributors

prohaska avatar prohaska7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.