1
== What is mydumper? Why? ==
3
* Parallelism (hence, speed) and performance (avoids expensive character set conversion routines, efficient code overall)
4
* Easier to manage output (separate files for tables, dump metadata, etc, easy to view/parse data)
5
* Consistency - maintains snapshot across all threads, provides accurate master and slave log positions, etc
6
* Manageability - supports PCRE for specifying database and tables inclusions and exclusions
8
It does not support schema dumping and leaves that to 'mysqldump --no-data'
10
== How to build it? ==
15
One needs to install development versions of required libaries (MySQL, GLib, ZLib, PCRE):
17
* Ubuntu or Debian: apt-get install libglib2.0-dev libmysqlclient15-dev zlib1g-dev libpcre3-dev
18
* Fedora, RedHat and CentOS: yum install glib2-devel mysql-devel zlib-devel pcre-devel
19
* MacOSX: port install glib2 mysql5 pcre
21
One has to make sure, that pkg-config, mysql_config, pcre-config are all in $PATH
23
== How does consistent snapshot work? ==
25
This is all done following best MySQL practices and traditions:
27
* Global write lock is acquired ("FLUSH TABLES WITH READ LOCK")
28
* Various metadata is read ("SHOW SLAVE STATUS","SHOW MASTER STATUS")
29
* Other threads connect and establish snapshots ("START TRANSACTION WITH CONSISTENT SNAPSHOT")
30
** On pre-4.1.8 it creates dummy InnoDB table, and reads from it.
31
* Once all worker threads announce the snapshot establishment, master executes "UNLOCK TABLES" and starts queueing jobs.
33
This for now does not provide consistent snapshots for non-transactional engines - support for that is expected in 0.2 :)
35
== How to exclude (or include) databases? ==
37
Once can use --regex functionality, for example not to dump mysql and test databases:
39
mydumper --regex '^(?!(mysql|test))'
41
Of course, regex functionality can be used to describe pretty much any list of tables.
43
== How to exclude MERGE or Federated tables ==
45
Use same --regex exclusion syntax. Again, engine-specific behaviors are targetted for 0.2