root-shell> zfs send -i scratchpool@snap1 scratchpool@snap2|ssh
Doublecheck that the slave has the data by looking at the MySQL data directory on the slavepool:
root-shell> ls -al /slavepool/mysql-data/
Now you can start up MySQL, create some data, and then replicate the changes using
to the slave to synchronize the changes.
zfs recv
The rate at which you perform the synchronization depends on your application and environment.
The limitation is the speed required to perform the snapshot and then to send the changes over the
network.
To automate the process, create a script that performs the snapshot, send, and receive operation, and
use
to synchronize the changes at set times or intervals.
cron
15.5.3. Handling MySQL Recovery with ZFS
When using ZFS replication to provide a constant copy of your data, ensure that you can recover your
tables, either manually or automatically, in the event of a failure of the original system.
In the event of a failure, follow this sequence:
1. Stop the script on the master, if it is still up and running.
2. Set the slave file system to be read/write:
root-shell> zfs set readonly=off slavepool
3. Start up
mysqld
to make sure the table data is correct, as shown here when I started up from our mid-INSERT
snapshot:
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
081109 15:59:59
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
081109 16:00:03
081109 16:00:03 [Note] /slavepool/mysql-5.0.67-solaris10-i386/bin/mysqld: ready for connections.
Version: '5.0.67'
Use
InnoDB
loss. On MyISAM tables, you might need to run
information.
15.6. Using MySQL with
is a simple, highly scalable key-based cache that stores data and objects wherever
memcached
dedicated or spare RAM is available for quick access by applications, without going through layers of
parsing or disk I/O. To use, you run the
shared cache to store objects. For more usage instructions, see
Benefits of using
• Because all information is stored in RAM, the access speed is faster than loading the information
each time from disk.
• Because the "value" portion of the key-value pair does not have any data type restrictions, you can
cache data such as complex structures, documents, images, or a mixture of such things.
Handling MySQL Recovery with ZFS
on the slave. If you are using InnoDB, you get auto-recovery, if it is needed,
InnoDB: Database was not shut down normally!
InnoDB: Started; log sequence number 0 1142807951
socket: '/tmp/mysql.sock'
tables and a regular synchronization schedule to reduce the risk for significant data
memcached
include:
memcached
port: 3306
TABLE, and you might even have lost some
REPAIR
command on one or more hosts and then use the
memcached
1337
id@host
pfexec zfs recv slavepool
zfs
MySQL Community Server (GPL)
Section 15.6.2, "Using memcached"
send/
Need help?
Do you have a question about the 5.0 and is the answer not in the manual?
Questions and answers