Solved

Promote MySQL Slave to Master and set up a new slave

Posted on 2014-10-03
2
355 Views
Last Modified: 2014-10-30
Hi,

I had two mysql servers running in replication Master(DB1) -> Slave(DB2). DB1 server has died. I have switched all my applications to use DB2.

I now need to re-setup replication. So I need to set up a new server with MySQL (DB3) and then I want to replicate DB2 to DB3 using DB2 as the master and DB3 as the slave.

How do I do this?

I am running a fairly critical system.

Thanks for your help!
0
Comment
Question by:jrm213jrm213
2 Comments
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 250 total points
ID: 40361103
HI!

Just follow the manual for setting up the replication (just select your mysql version ).
It's very simple. :)
http://dev.mysql.com/doc/refman/5.5/en/replication-howto.html

Here are some other tutorials
http://www.rackspace.com/knowledge_center/article/mysql-replication-masterslave
http://plusbryan.com/mysql-replication-without-downtime

Regards,
      Tomas Helgi
0
 
LVL 7

Assisted Solution

by:Stampel
Stampel earned 250 total points
ID: 40370911
Is TomasHelgi answer sufficient or do you need detailed help ?
First you have to start DB2 with --log-bin option so it can start writing logs.
Then use "show master status" on DB2
Then on "DB3" the new slave , use the following commands :

mysql> CHANGE MASTER TO MASTER_HOST='XXX (DB2)', MASTER_USER='XXX', MASTER_PASSWORD='XXX', MASTER_LOG_FILE='mysqld-bin.XXXXXX', MASTER_LOG_POS=XXX;

mysql> START SLAVE;

You will have to replace XXX with the values you got from the "show master status" you used first.
It's not very difficult and there is not much risk.
Tell me if you need realtime help.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi (http://code.openark.org/blog/mysql/on-restoring-a-single-table-from-mysqldump) had suggested a “sed” way, I actually shell …
Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now