Restoring an External Backup
If a backup has been performed outside of the Tungsten software, for example from filesystem snapshot or a backup performed outside of the dataservice, follow these steps:
Shun the datasource to be restored, and put the replicator service offline using
cctrl:[LOGICAL:EXPERT] /alpha > datasource host2 shun[LOGICAL:EXPERT] /alpha > replicator host2 offlineReset the THL, either using
thlor by deleting the files directly :shell> thl -service alpha purgeRestore the data or files using the external tool. This may require the database server to be stopped. If so, you should restart the database server before moving to the next step.
NoteThe backup must be complete and the
tungstenspecific schemas must be part of the recovered data, as they are required to restart replication at the correct point. See "Creating an External Backup" for more information on creating backups.There is some additional work if the backup was taken of the Primary server. There may be a difference between the binary log position of the Primary and what is represented in the trep_commit_seqno. If these values are the same, you may proceed without further work. If not, the content of trep_commit_seqno must be updated.
Retrieve the contents of trep_commit_seqno :
shell> echo "select seqno,source_id, eventid from tungsten_alpha.trep_commit_seqno" | tpm mysqlseqno source_id eventid32033674 host1 mysql-bin.000032:0000000473860407;-1Compare the results to the binary log position of the restored backup. For this example we will assume the backup was taken at
mysql-bin.000032:473863524. Return to the Primary and find the correct sequence number for that position :shell> ssh host1shell> thl dsctl -event mysql-bin.000032:0000000473863524dsctl -service alpha set -reset -seqno 7748 -epoch 0 -event-id "mysql-bin.000032:0000000473863524" -source-id "db1-east.continuent.com"~OR~shell> thl list -event mysql-bin.000032:0000000473863524 -headersSEQ# = 7748 / FRAG# = 0 (last frag)- FILE = thl.data.0000000010- TIME = 2014-10-17 16:58:11.0- EPOCH# = 0- EVENTID = mysql-bin.000032:0000000473863524;-1- SOURCEID = db1-east.continuent.comshell> exitReturn to the Replica node and run
dsctl setto update the trep_commit_seqno table:shell> dsctl -service alpha set -reset \-seqno 7748 \-epoch 0 \-source-id db1-east.continuent.com \-event-id mysql-bin.000032:0000000473863524
Recover the datasource using
cctrl:[LOGICAL] /alpha > datasource host2 recoverThe
datasource recovercommand will start the dataserver if it was left running and then bring the replicator and other operations online.