If a backup has been performed outside of Tungsten Cluster, for example from filesystem snapshot or a backup performed outside of the dataservice, follow these steps:
Put the replication service offline using trepctl:
shell> trepctl offline
Reset the THL, either using thl or by deleting the files directly :
shell> thl -service alpha purge
Restore 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.
The backup must be complete and the
tungsten
specific schemas must
be part of the recovered data, as they are required to restart
replication at the correct point. See
Section 6.7.3, “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 mysql
seqno source_id eventid
32033674 host1 mysql-bin.000032:0000000473860407;-1
Compare 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
shell>host1
thl list -service
32033678 32030709 0 true 2014-10-17 16:58:11.0 mysql-bin.000032:0000000473863524;-1 db1-east.continuent.com shell>alpha
-low32033674
-headers | grep473863524
exit
Return to the Replica node and run
tungsten_set_position to update the
trep_commit_seqno
table :
shell> tungsten_set_position --service=alpha
--source=host1
--seqno=32033678
Put the replication service online using trepctl:
shell> trepctl online