MYSQL master/master switchover (master database down) bitsCN.com
MYSQL master/master switchover (master database down)
Switch the Master (3307 write-3308 read)
Premise: 3307 downtime
1. modify the configuration file. Command line operations
Vim/home/bbq/mysql/mysql-3308/cnf/my. cnf
# Delete in [mysqld]
# Read_only
2. restart mysqld3308. Command line operations
Service mysqld3308 restart
3. check whether the SQL statement of the master database is executed in the slave database. Mysql client operations
#3308 run: show processlist;
One of the threads whose user is 'system user'
If the value of State is "Reading event from the relay log", it indicates that the relay log SQL statement for master database synchronization is being executed.
If the State value is "Slave has read all relay log; waiting for the slave I/O thread to update it", it indicates that the relay log SQL statement synchronized from the master database has been executed.
IV. Business connection 3308
5. 3307 after the repair is completed
# Modifying the configuration file
Vim/home/bbq/mysql/mysql-3307/cnf/my. cnf
# Add in [mysqld]
Read_only
# Start the service
Service mysqld3307 restart
BitsCN.com