{"id":613,"date":"2012-08-24T00:32:17","date_gmt":"2012-08-24T00:32:17","guid":{"rendered":"http:\/\/www.omniweb.com\/wordpress\/?p=613"},"modified":"2012-08-24T04:29:31","modified_gmt":"2012-08-24T04:29:31","slug":"verify-integrity-of-mysql-slaves","status":"publish","type":"post","link":"https:\/\/www.omniweb.com\/wordpress\/?p=613","title":{"rendered":"Verify integrity of MySQL slaves"},"content":{"rendered":"<p>Using this tool <a href=\"http:\/\/www.maatkit.org\/doc\/mk-table-checksum.html\">http:\/\/www.maatkit.org\/doc\/mk-table-checksum.html<\/a><\/p>\n<p>Download the program to the master db server:<br \/>\n<code>wget http:\/\/www.maatkit.org\/get\/mk-table-checksum<\/code><\/p>\n<p>Create the needed table in your DB;<br \/>\n <code>CREATE TABLE checksum (<br \/>\n     db         char(64)     NOT NULL,<br \/>\n     tbl        char(64)     NOT NULL,<br \/>\n     chunk      int          NOT NULL,<br \/>\n     boundaries char(100)    NOT NULL,<br \/>\n     this_crc   char(40)     NOT NULL,<br \/>\n     this_cnt   int          NOT NULL,<br \/>\n     master_crc char(40)         NULL,<br \/>\n     master_cnt int              NULL,<br \/>\n     ts         timestamp    NOT NULL,<br \/>\n     PRIMARY KEY (db, tbl, chunk)<br \/>\n  );<\/code><\/p>\n<p>Make the program executable and run it;<br \/>\n<code>chmod +x mk-table-checksum<br \/>\n.\/mk-table-checksum --replicate=MY_DATABASE.checksum h=localhost,u=USER,p=PASS --replicate-database=MY_DATABASE --databases=MY_DATABASE<\/code><\/p>\n<p>On the slaves, look at any inconsistencies:<br \/>\n<code>SELECT * FROM checksum WHERE this_crc != master_crc;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using this tool http:\/\/www.maatkit.org\/doc\/mk-table-checksum.html Download the program to the master db server: wget http:\/\/www.maatkit.org\/get\/mk-table-checksum Create the needed table in your DB; CREATE TABLE checksum ( db char(64) NOT NULL, tbl char(64) NOT NULL, chunk int NOT NULL, boundaries char(100) NOT &hellip; <a href=\"https:\/\/www.omniweb.com\/wordpress\/?p=613\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/613"}],"collection":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=613"}],"version-history":[{"count":5,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/613\/revisions"}],"predecessor-version":[{"id":630,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/613\/revisions\/630"}],"wp:attachment":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}