How to ensure MySQL replication is accurate? -


i've used replication sql database. when compare table sizes differ slightly. find odd contain same number of rows.

i've read due slave server being more optimized great. makes difficult know if has gone wrong.

would checking slave periodically with

show slave status\g 

be enough check if there inconsistencies? show if there error or if 1 of main threads had stopped.

i thought check database size with

select table_schema "data base name",  sum( data_length + index_length ) / 1024 /  1024 "data base size in mb",  sum( data_free )/ 1024 / 1024 "free space in mb"  information_schema.tables  group table_schema ;  

is there easier way of checking slave identical master?

to check data integrity

use percona's pt-table-checksum verify data integrity.

pt-table-checksum performs online replication consistency check executing checksum queries on master, produces different results on replicas inconsistent master. optional dsn specifies master host. tool’s “exit status” non-zero if differences found, or if warnings or errors occur.

source: http://www.percona.com/doc/percona-toolkit/2.2/pt-table-checksum.html

to check whether slave running

do show slave status , check both slave_io_running , slave_sql_running "yes".


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -