Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
<!-
- 		@page

{ size: 8.5in 11in; margin: 0.79in }

P

{ margin-bottom: 0.08in }

\-->This document details how to switch the MySQL replication master to a new machine. It makes the following assumptions:
\\

1.	There are two MySQL machines in a replication configuration
2.	There is one master and one slave
3.	Both are configured to be master-capable
4.	The master has failed and there is a need to make the slave the master


STEPS TO PROCEED:


1.	Stop Tomcat

{code}
/etc/init.d/tomcat stop
{code}
2.	Stop Shibboleth

{code}
/etc/init.d/shibd stop
{code}

3.	Shut down the master database by executing the following on the master machine:

{code}
/etc/init.d/mysql stop
{code}

4.	On the slave server, log into MySQL:

{code}
/usr/local/mysql/bin/mysql -u root -p
{code}
5.	On the slave server, stop the slave processing:
{code}
mysql> stop slave;
{code}
6.	Stop the slave server:

{code}
/etc/init.d/mysql stop
{code}
7.	On the slave server, add the following option to the /etc/my.cnf file:

{code}
skip_slave_start
{code}

--- Please note that now your old slave server will be the new master ---
\--\- All references to "Master" now refer to the former slave, now master ---
\--\- All references to "Slave" now refer to the newly-configured slave ---
\--\- The newly-configured slave will usually be the old master ---


8.	Start the master server:

{code}
/etc/init.d/mysql start
{code}

9.	In the /usr/local/tomcat/conf/server.xml file on the new master, edit the "url=" line for the CAMS section, and make sure the address for the MySQL connection is correct.


10.	In the /usr/local/tomcat/conf/context.xml file on the new master, edit the "url=" line in the Resource section, and make sure the address for the MySQL connection is correct.


11.	In the /usr/local/shibboleth-idp/etc/resolver.jdbc.xml file on the new master, edit the "dbURL" line in the "JDBCDataConnector" section, and make sure the address for the MySQL connection is correct.


12.	Set up a slave server using the Touchstone MySQL Replication instructions.


13.	Ensure that the /usr/local/tomcat/conf/server.xml, /usr/local/tomcat/conf/context.xml, and /usr/local/shibboleth-idp/etc/resolver.jdbc.xml files on the new slave server have the correct database URLs, as above.

14.	Start the Tomcat server
{code}
/etc/init.d/tomcat start
{code}

15.	Stop the Tomcat server

{code}
/etc/init.d/shibd start
{code}
\[\]
Wiki Markup
{section:border=false}
{column:width=70%}
<\!-\
Section
borderfalse
Column
width70%
Wiki Markup
Column
width30%
Wiki Markup