I’m using pt-table-sync to try to synchronize a table between two hosts. I have executed this command (Passwords are clear because are hosts in lan environment - lab):
pt-table-sync h=127.0.0.1,u=root,p=mySQL3v@n,P=3306,D=radius,t=radcheck h=192.168.1.78,u=root,p=m1rr0r,P=3306,D=radius,t=radcheck --execute --replicate percona.checksums
This command’s output shows a lot of querys (REPLACE INTO) but I would like to get differences between both only. So, what is wrong? Anybody can help me?
Thanks in advance.
If master and slave servers are not sync then there are two different tools which you can use for make it sync.
- pt-table-checksum – which will run the checksum and check integrity between master and slave servers. so will show you differences.
- pt-table-sync – which will synchronize data between master-slave servers
Thanks for your reply niljoshi.
So, are these commands independent between them?
And another question … I have executed a pt-table-checksum and shows some differences between master and slave. My intention is to solve these differences, so, after that I have executed pt-table-sync. A second pt-table-checksum shows differences again. Is this normal? (Maybe yes, because is a replication environment, with some activity …)
In conclusion: How can be sure to that there are not differences between master and slave?
Thanks in advance for your help and your advices.
Yes, both are individual tool. If you see still differences after running pt-table-sync then there must be some issue with the process which you are following OR some bug…god knows. You can verify it by checking for which table you are getting differences and for that are you getting replace statements in pt-table-sync? provide which steps you are following with output.
Though, its replication, pt-table-sync will not directly run those statements in slave…but it will run in master…to slave. Thats why its replace not insert.
please read above documentations for detailed information.