If a restore is being performed as part of the recovery procedure, consider using the tungsten_provision_slave tool. This is will work for restoring from the master or a slave and is faster if you do not already have a backup ready to be restored. For more information, see Section 126.96.36.199, “Provision or Reprovision a Slave”.
Data can be restored to a slave by performing a backup on a different slave, transferring the backup information to the slave you want to restore, and then running restore process.
For example, to restore the
from a backup performed on
Run the backup operation on
[LOGICAL:EXPERT] /alpha >
datasource host2 backupUsing the 'xtrabackup' backup agent. Replicator 'host2' starting backup Backup of dataSource 'host2' succeeded; uri=storage://file-system/store-0000000006.properties
Copy the backup information from
Section D.1.1.3, “Copying Backup Files” for more information
on copying backup information between hosts. If you are using
xtrabackup there will be additional files needed
before the next step. The example below uses scp to
copy a mysqldump backup:
scp store-*6[\.-]* host3:$PWD/store-0000000006-mysqldump-812096863445699665.sql 100% 234MB 18.0MB/s 00:13 store-0000000006.properties 100% 314 0.3KB/s 00:00
If you are using xtrabackup:
rsync -aze ssh full_xtrabackup_2014-08-16_15-44_86 host3:$PWD/
Shun the datasource to be restored, and put the replicator service offline using cctrl :
[LOGICAL] /alpha >
datasource host2 shun[LOGICAL] /alpha >
replicator host2 offline
Restore the backup using cctrl :
[LOGICAL] /alpha >
datasource host2 restore
Once the restore operation has completed, the datasource will be placed into the online state.
Check the ownership of files if you have trouble transferring files or restoring the backup. They should be owned by the Tungsten system user to ensure proper operation.