Using pt-table-checksum to compare a slave's DB to another slave
-
10-12-2020 - |
Pergunta
I understand that pt-table-checksum can do checksum compares between a master's DB and a slave's DB easily.
However, let's say your master has two slaves replicating from it for the same DB, i.e. Slave 1 and Slave 2.
Is there a way to use pt-table-checksum to run a direct checksum comparison between Slave 1 and Slave 2's databases? In this scenario, I am not as concerned with comparing any of the slaves with the master itself.
Thanks IS
Solução
If I'm not mistaken the pt-table-checksum uses report_host
value to find slaves.
May I suggest:
- stop slave2. Note its current position.
- Temporarily set up slave2 to replicate slave1 (binglog needs to be enabled on slave1)
- Start only the io thread to get replication chain (i.e.
start slave io_thread;
) - Run pt-table-checksum from slave1
- After check is done, stop slave and restore original replication on slave2 with saved position
This way you don't run the risk of messing up any slave.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a dba.stackexchange