

Pt-table-checksum could not find the slaves. Notice we had errors: (I cropped out the rest of the output since it does not show a good run of pt-table-checksum.) Pt-table-checksum -user=sbtest -socket=/tmp/mysql_sandbox21324.sock -port=21234 -ask-pass -no-check-binlog-format Now we are ready to move on to the pt-table-checksum tool. Remember to populate this data based on your cluster We will need this database and table to hold our checksums and DSNS data.Ĭreate database percona use percona CREATE TABLE ` dsns ` ( ` id ` int ( 11 ) NOT NULL AUTO_INCREMENT, ` parent_id ` int ( 11 ) DEFAULT NULL, ` dsn ` varchar ( 255 ) NOT NULL, PRIMARY KEY ( ` id ` ) ) insert into dsns ( id, parent_id, dsn ) values ( 1, 1, "h=percona-lab,u=sbtest,p=sbtest!,P=21325" ) insert into dsns ( id, parent_id, dsn ) values ( 2, 2, "h=percona-lab,u=sbtest,p=sbtest!,P=21326" ) Let’s connect to mysql and create a percona database and add the dsns table. Make sure you do a quick select * from percona.synctest Insert into names (fname,lname) values (‘Micky','Mouse') Insert into names (fname,lname) values ('Number','Two') Insert into names (fname,lname) values ('Number','One')

Insert into names (fname,lname) values ('Money','Penny') Insert into names (fname,lname) values ('Gold','Finger') Insert into names (fname,lname) values ('Doctor','No') Insert into names (fname,lname) values ('James','Bond') Insert into names (fname,lname) values ('Joe','Howard') Insert into names (fname,lname) values ('Shemp','Howard') Insert into names (fname,lname) values ('Curly','Howard') Insert into names (fname,lname) values ('Larry','Howard') Insert into names (fname,lname) values ('Moe','Howard') While in your sandboxes/cluster directory run this command:Ĭonnect you to the master: mysql -socket=/tmp/mysql_sandbox21325.sock -port=21325 -u sbtest -pĬreate table names (id int not null auto_increment primary key, fname varchar(50), lname varchar(50)) Let’s move on and add some data to play with. * Please note that the location of your cluster might be different. Note: we will stay in the _$HOME/sandboxes/rsandboxps8.0.23_ for remainder of this post. Take time to make yourself familiar with the scripts in this directory. This will display information about your new cluster. Lets verify our Cluster: dbdeployer sandboxes -full-infoĬhange directories into you cluster directory: _$HOME/sandboxes/rsandboxps8.0.23_ and run the. custom-role-privileges='ALL PRIVILEGES' \
Be insync install#
:max_bytes(150000):strip_icc()/nsync-its-gonna-be-me-5777164a3df78cb62cbf088b.png)
sudo percona-release enable tools release.sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb.sudo apt install gnupg2 curl libaio-dev libncurses-dev mysql-client-core-8.0.For this I will be using Virtualbox and Ubuntu 20.04LTS. Let’s start off by setting up a VM to play with. We will also use dbdeployer to help us setup a testing sandbox. Keep in mind this approach might not work for all situations. With pt-table-check and pt-table-sync provided by Percona Toolkit we can recover a replica without needed to do a restore.
Be insync full#
Please take a few moments to review the full documentation of both tools before trying this example on live data: pt-table-checksum, pt-table-sync. Not a painful process but time consuming. I can remember long nights of restoring backups of the primary to the replica’s.

Most of the time this happens is due to network packet drops or a replica crashes before new data is committed. I have only seen a handful of times when writes did not get applied to the replica. The fundamental issue with async replication is that writes sent to the Replica are not guaranteed to be written. Add the use of GTID’s and you have a very Percona Toolkit + pt-table-checksum + pt-table-sync = Faster Replica RecoveryĪsynchronous replication with MySQL is a tried and true technology.
