Replication question: How to make a slave a master?
I have a couple of mysql database slaves and would like to make one of them be a master as well so that I can set another machine to replicate from it. Can anyone tell me how I should go about it or know of any howtos for this specific task? Thanks, Richard
Re: Replication question: How to make a slave a master?
Am 24.08.2012 17:25, schrieb Richard Reina: I have a couple of mysql database slaves and would like to make one of them be a master as well so that I can set another machine to replicate from it. Can anyone tell me how I should go about it or know of any howtos for this specific task? add the same master-conig lines as you did on the other master there is no magic, master-configurazion does not have any impact to slave-operation and vice versa signature.asc Description: OpenPGP digital signature
RE: Replication question: How to make a slave a master?
Pointing the other slave to the new master is a bit tricky. -Original Message- From: Reindl Harald [mailto:h.rei...@thelounge.net] Sent: Friday, August 24, 2012 8:29 AM To: mysql@lists.mysql.com Subject: Re: Replication question: How to make a slave a master? Am 24.08.2012 17:25, schrieb Richard Reina: I have a couple of mysql database slaves and would like to make one of them be a master as well so that I can set another machine to replicate from it. Can anyone tell me how I should go about it or know of any howtos for this specific task? add the same master-conig lines as you did on the other master there is no magic, master-configurazion does not have any impact to slave-operation and vice versa -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: Replication question: How to make a slave a master?
what would be tricky? remove all relay-logs, remove master.info adn that was it done this many times in the last years and it takes 30 seconds if you are fast enough to type the slave-commands Am 24.08.2012 23:35, schrieb Rick James: Pointing the other slave to the new master is a bit tricky. -Original Message- From: Reindl Harald [mailto:h.rei...@thelounge.net] Sent: Friday, August 24, 2012 8:29 AM To: mysql@lists.mysql.com Subject: Re: Replication question: How to make a slave a master? Am 24.08.2012 17:25, schrieb Richard Reina: I have a couple of mysql database slaves and would like to make one of them be a master as well so that I can set another machine to replicate from it. Can anyone tell me how I should go about it or know of any howtos for this specific task? add the same master-conig lines as you did on the other master there is no magic, master-configurazion does not have any impact to slave-operation and vice versa -- Reindl Harald the lounge interactive design GmbH A-1060 Vienna, Hofmühlgasse 17 CTO / CISO / Software-Development p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40 icq: 154546673, http://www.thelounge.net/ http://www.thelounge.net/signature.asc.what.htm signature.asc Description: OpenPGP digital signature
RE: Replication question: How to make a slave a master?
It's the sequence that is tricky. 1. STOP SLAVE 2. CHANGE MASTER 3. START SLAVE Do it wrong, and you miss or duplicate replication stuff that happens between #1 and #2. Could you please lay out the precise steps, so that I can understand how un-tricky it can be. -Original Message- From: Reindl Harald [mailto:h.rei...@thelounge.net] Sent: Friday, August 24, 2012 2:43 PM To: mysql@lists.mysql.com Subject: Re: Replication question: How to make a slave a master? what would be tricky? remove all relay-logs, remove master.info adn that was it done this many times in the last years and it takes 30 seconds if you are fast enough to type the slave-commands Am 24.08.2012 23:35, schrieb Rick James: Pointing the other slave to the new master is a bit tricky. -Original Message- From: Reindl Harald [mailto:h.rei...@thelounge.net] Sent: Friday, August 24, 2012 8:29 AM To: mysql@lists.mysql.com Subject: Re: Replication question: How to make a slave a master? Am 24.08.2012 17:25, schrieb Richard Reina: I have a couple of mysql database slaves and would like to make one of them be a master as well so that I can set another machine to replicate from it. Can anyone tell me how I should go about it or know of any howtos for this specific task? add the same master-conig lines as you did on the other master there is no magic, master-configurazion does not have any impact to slave-operation and vice versa -- Reindl Harald the lounge interactive design GmbH A-1060 Vienna, Hofmühlgasse 17 CTO / CISO / Software-Development p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40 icq: 154546673, http://www.thelounge.net/ http://www.thelounge.net/signature.asc.what.htm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: Replication question: How to make a slave a master?
* stop mysqld * rm -f mysql-relay-bin* * rm -f master.info * rm -f relay-log.info * start mysqld so, and now your slave is no longer any slave to make sure you are binary-identical with the new master stop the new master, remove all it's BINLOGS, not its relay-logs, stop the new salve, rsync the data, start both mywqld and start replication from slave this is really easy after you understand what each file in the datadir is supposded to do Am 24.08.2012 23:53, schrieb Rick James: It's the sequence that is tricky. 1. STOP SLAVE 2. CHANGE MASTER 3. START SLAVE Do it wrong, and you miss or duplicate replication stuff that happens between #1 and #2. Could you please lay out the precise steps, so that I can understand how un-tricky it can be. -Original Message- From: Reindl Harald [mailto:h.rei...@thelounge.net] Sent: Friday, August 24, 2012 2:43 PM To: mysql@lists.mysql.com Subject: Re: Replication question: How to make a slave a master? what would be tricky? remove all relay-logs, remove master.info adn that was it done this many times in the last years and it takes 30 seconds if you are fast enough to type the slave-commands Am 24.08.2012 23:35, schrieb Rick James: Pointing the other slave to the new master is a bit tricky. -Original Message- From: Reindl Harald [mailto:h.rei...@thelounge.net] Sent: Friday, August 24, 2012 8:29 AM To: mysql@lists.mysql.com Subject: Re: Replication question: How to make a slave a master? Am 24.08.2012 17:25, schrieb Richard Reina: I have a couple of mysql database slaves and would like to make one of them be a master as well so that I can set another machine to replicate from it. Can anyone tell me how I should go about it or know of any howtos for this specific task? add the same master-conig lines as you did on the other master there is no magic, master-configurazion does not have any impact to slave-operation and vice versa -- Reindl Harald the lounge interactive design GmbH A-1060 Vienna, Hofmühlgasse 17 CTO / CISO / Software-Development p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40 icq: 154546673, http://www.thelounge.net/ http://www.thelounge.net/signature.asc.what.htm -- Reindl Harald the lounge interactive design GmbH A-1060 Vienna, Hofmühlgasse 17 CTO / CISO / Software-Development p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40 icq: 154546673, http://www.thelounge.net/ http://www.thelounge.net/signature.asc.what.htm signature.asc Description: OpenPGP digital signature
Re: Replication question: How to make a slave a master?
Are you trying to promote a slave as a new master and replace current master or create intermediate slave? If it is the latter all you need to do is to: 1. Stop the slave 2. Add log_slave_updates = 1 in the slave's config file 3. Copy the slave files to the new slave(s) 4. Start your intermediate slave 5. Add replication user on your intermediate slave and allow new slaves to replicate 6. Start your slave(s) of intermediate slave 7. Issue following on your new slaves: CHANGE MASTER TO master_log_file = 'mysql-bin.01', master_log_pos = 4; On Aug 24, 2012, at 11:25 AM, Richard Reina wrote: I have a couple of mysql database slaves and would like to make one of them be a master as well so that I can set another machine to replicate from it. Can anyone tell me how I should go about it or know of any howtos for this specific task? Thanks, Richard -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql