Since everything is MyISAM, here is what you need to do
STEP 01) Configure Master to be a Replication Master
If you do not have
server-id defined in /etc/my.cnf, add one
service mysql restart
STEP 02) Check Binary Logging on the Master
If binary logging is active on the Master, do this
to zap all binary logs and start fresh.
If binary logging is not active, do this
[mysqld] in /etc/my.cnf
- service mysql restart
STEP 03) Copy
You could set rsync to perform a brute force byte-by-byte copy of your MyISAM tables from
/var/lib/mysql on one server to
/var/lib/mysql on another server. You would have perform multiple rsyncs until the last rsync, which is very quick. Then, you would do a full shutdown of MySQL and perform one more rsync. Start mysql on both Master and Slave.
STEP 04) Create Replication User on the Slave
GRANT REPLICATION CLIENT,REPLICATION SLAVE
ON *.* TO replicator@'PrivateIPofSlave' IDENTIFIED BY 'r3pl1cAt0r';
STEP 05) Set up replication
Run this command on the Slave
CHANGE MASTER TO
What is XXXX and YYYY ???
XXXX is the last binary log file at the time you perform final rsync. There is a copy of that file in /var/lib/mysql on the Slave. Just run
ls -l /var/lib/mysql/mysql-bin.0* on the Slave and use the last binary log.
YYYY is the position of the last binary log file at the time you perform final rsync. Interestingly, the position is also the filesize of the binary log. Just run
ls -l /var/lib/mysql/mysql-bin.0* on the Slave and take the last binary log's filesize to be the position
STEP 06) Check replication
SHOW SLAVE STATUS\G
Yes, Congratulations You are Done !!!
I have written similar posts on using rsync like this: