How to setup a new slave:
-
Spin up a new ec 2 server (All in one AMI)
-
On the master database
-
./create_snapshot.sh
-
mysql -u root
-
SHOW MASTER STATUS;
-
Remember the file and the position!
-
Open setup_slave_init.sql
-
Update MASTER_LOG_FILE and MASTER_LOG_POS if they have changed.
-
git add .
-
git commit -m "New snapshot and configure for new slave"
-
git push origin master
-
On the new slave:
-
./setup_slave.sh [SLAVE NUMBER HERE]
-
Update config/shards.yml in the notify git to use the new slave number and address.
-
cap deploy!
Make sure that you increment the slave number each time!