安装
1 | wget https://www.percona.com/downloads/percona-toolkit/2.2.7/RPM/percona-toolkit-2.2.7-1.noarch.rpm |
1 | Installed: |
权限
1 | GRANT ALL PRIVILEGES ON `zabbix`.* TO 'pt'@'%' |
执行
pt-table-checksum
1 | #pt-table-checksum --nocheck-replication-filters --no-check-binlog-format --replicate=test_sync.checksums --create-replicate-table --databases=test_sync --tables=contact h=10.1.7.211,u=root,p=mysqlxxx,P=3306 |
pt-table-sync
1 | #pt-table-sync --replicate=test_sync.checksums h=10.1.7.211,u=root,p=mysqlxxx,P=3306 h=10.1.7.211,u=root,p=mysqlxxx,P=3307 --print |
err:
1 | Can't make changes on the master because no unique index exists at /usr/bin/pt-table-sync line 10649. while doing zabbix.history on 172.17.0.3 |
pt-heartbeat
1 | #pt-heartbeat --user=root --ask-pass --host=10.1.7.211 --port 3306 --create-table -D test_sync --interval=1 --update --replace --daemonize |