Section | ||
---|---|---|
| ||
Column | ||
---|---|---|
| ||
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 Block |
---|
Wiki Markup |
{section:border=false} {section} {column:width=70%} {column} 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 Block |
---|
} /etc/init.d/shibd stop {code} |
3.
...
Shut
...
down
...
the
...
master
...
database
...
by
...
executing
...
the
...
following
...
on
...
the
...
master
...
machine:
Code Block |
---|
} /etc/init.d/mysql stop {code} |
4.
...
On
...
the
...
slave
...
server,
...
log
...
into
...
MySQL:
Code Block |
---|
} /usr/local/mysql/bin/mysql -u root -p {code} |
5.
...
On
...
the
...
slave
...
server,
...
stop
...
the
...
slave
...
processing:
Code Block |
---|
} mysql> stop slave; {code} |
6.
...
Stop
...
the
...
slave
...
server:
Code Block |
---|
} /etc/init.d/mysql stop {code} |
7.
...
On
...
the
...
slave
...
server,
...
add
...
the
...
following
...
option
...
to
...
the
...
/etc/my.cnf
...
file:
Code Block |
---|
} skip_slave_start {code} --- Please note that now your old slave server will be the new master - |
— 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 Block |
---|
-- \--\- 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 Block |
---|
} /etc/init.d/tomcat start {code} |
15.
...
Stop
...
the
...
Tomcat
...
server
Code Block |
---|
} /etc/init.d/shibd start {code} |