I’ve seen the “6 step tutorial” and it is great, except it requires me to login into the master shell and it requires double the db size disk space because the initial backup is done locally. For these and simplicity I’d prefer to setup a slave from the slave itself using streaming. I’ve put together the following procedure. I am having doubts if these is all correct and also necessary, specifically the step 3. After all, the slave will catch up with master once connected. Can someone, please, advise.
/etc/init.d/mysql stop
rm -rf /var/lib/mysql/*
ssh root@master "innobackupex --user=root --password master_password --stream=tar /tmp/ --slave-info | gzip -" | gunzip - | tar xfi - -C /var/lib/mysql
innobackupex --user=root --password=master_password --apply-log /var/lib/mysql/
chown mysql:mysql /var/lib/mysql -R
/etc/init.d/mysql start
cat /var/lib/mysql/xtrabackup_binlog_info
mysql -uroot -pmaster_password -e "CHANGE MASTER TO MASTER_HOST='master', MASTER_USER='mirror', MASTER_PASSWORD='mirror_password', MASTER_LOG_FILE='mysql-bin.XXX', MASTER_LOG_POS=XXX;"