Replication

On Primary:
– Lock tables:
FLUSH TABLES WITH READ LOCK;
keep this window open

– on another screen:
SHOW MASTER STATUS;
mysql-bin.000088 | 338004

On Secondary:
– stop mysql

On primary:
rsync -Sa –progress –exclude=mastername* –exclude=master.info –exclude=relay-log.info /var/lib/mysql/* <replicant>:/var/lib/mysql

On Secondary:
– start mysql
– start replication:
CHANGE MASTER TO
MASTER_HOST=’ip’,
MASTER_USER=’mysql_backup’,
MASTER_PASSWORD='<pass>’, MASTER_LOG_FILE=’mysql-bin.000088′, MASTER_LOG_POS=338004

On primary:
– close original window

Leave a Reply

Your email address will not be published. Required fields are marked *