MySQL Replication
From CharlieWiki
This is the process used to add a new MySQL Slave to the YourWiki cluster of servers. I keep this as a reference, as some of the documentation on the MySQL site doesn't work/is out of date.
[edit] Steps
- Stop the original Slave (
mysqladmin shutdown) - rsync/transfer over the original datadir to the new slave
- Change server-id on the new slave to the next available ID (List of MySQL Server IDs)
- Start the new slave (
/etc/init.d/mysql start) - Run the SQL Queries to get it setup:
- SHOW SLAVE STATUS;
- RESET SLAVE;
- CHANGE MASTER TO
- MASTER_HOST='serv3.mudoo.net',
- MASTER_USER='repl',
- MASTER_PASSWORD='xxxxx',
- MASTER_LOG_FILE='WhatSlaveStatusSays',
- MASTER_LOG_POS=WhatSlaveStatusSays;
- START SLAVE;
- Setup DNS for it, etc.
- Add it to the load balancer in
LocalSettings.php.