MYSQL master/master switchover (master database down) _ MySQL

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.