Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to perform AB replication with mysql synchronization

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces you how to synchronize mysql AB replication, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Project environment:

The systems are all cent os 5.5,

Primary server IP:192.168.19.172 (master)

Slave server IP:192.168.19.168 (slave)

Both stations have set up mysql (root user, password is empty)

1: set synchronization master and modify mysql main configuration file:

Server-id = 1

Log-bin

Set-variable=binlog-ignore-db=mysql

2: then add an account to Master for synchronization, as follows:

GRANT REPLICATION SLAVE ON *. * TO IDENTIFIED BY rep

3: query master status (master)

Show master status

Note:

Record the file and position parameters on the master server

4: configure slave server slave, modify configuration file

Modify my.cnf by adding the following lines:

Server-id = 2

Master-user = rep

Master-password = rep

Master-port = 3306

5: configure command items,

6:start slave; has replication enabled

7: view synchronization status,

Note:

Slave_IO_Running: Yes and Slave_SQL_Running: Yes if these two states are not yes, please check whether the above configuration is correct, mainly whether the file and position settings are correct, and whether the slave database can be logged in with the account of the master database.

On how to carry out mysql synchronization AB replication is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report