• install MySQL on all boxes
  • add the slave repl [email protected] into mysql on the master
  • Install percona-xtrabackup and run it on the master
mkdir /root/bak; innobackupex --user=root --password=blahblah /root/bak
  • apply the log
innobackupex --user=root --password=blahblah --apply-log /root/bak/$date/
  • copy the backup over to the slaves
  • stop mysql and mv the copy over
service mysql stop; mv /var/lib/mysql{,.old}; mv /root/bak/$date /var/lib/mysql; chown -R mysql. /var/lib/mysql; service mysql start</pre>
  • Grab the position and binlog name innobackup provided in /var/lib/mysql/xtrabackup_binlog_info

  • Set the master on the slaves

mysql> CHANGE MASTER TO   MASTER_HOST='$master_ip', MASTER_USER='repl', MASTER_PASSWORD='something', MASTER_PORT=3306,   MASTER_LOG_FILE='mysql-bin.$number', MASTER_LOG_POS=$position,   MASTER_CONNECT_RETRY=10
  • start the slaving
mysql> slave start
  • Watch the seconds behind counter on the slave
mysql -e 'show slave status\G'