# Replication setup

**URL:** <https://forums.percona.com/t/replication-setup/4364>\
**Category:** Other MySQL® Questions\
**Created:** [August 21, 2015, 1:46am UTC](https://forums.percona.com/t/replication-setup/4364 "2015-08-21T01:46:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jrivera](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jrivera/32/13_2.png) [@jrivera](https://forums.percona.com/u/jrivera)\
**Post date:** [August 21, 2015, 7:16am UTC](https://forums.percona.com/t/replication-setup/4364/2 "2015-08-21T07:16:49Z")

</div>

I’ve started playing around with MHA and I should say it works great for manual or even automated failover of master-slave replication servers. 🙂

Steps 1 and 2 are solid.  
Step 3. you’d want to do, `STOP SLAVE; RESET SLAVE ALL;` as it is 5.6  
Step 4. set global read\_only=0;  
Step 5. these are optional and read\_only can be changed online.  
Step 6. SHOW MASTER STATUS; on old slave/new master  
Step 7. CHANGE MASTER TO … (use log file and position from #6)  
Step 8. set global read\_only=1; on new slave/old master  
Step 8. start slave; show slave status\G on new slave/old master.

Again with MHA ([url][https://code.google.com/p/mysql-master-ha/wiki/Overview[/url]](https://code.google.com/p/mysql-master-ha/wiki/Overview%5B/url%5D)), it would be as easy as :

shell\> masterha\_master\_switch --master\_state=alive --conf=/etc/app1.cnf --new\_master\_host=old\_slave --orig\_master\_is\_new\_slave

---

_[View the full topic](https://forums.percona.com/t/replication-setup/4364)._
