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

Master-Slave Construction based on GTID

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Note: what is built here is one master and multiple slaves.

Environment: centos7+MySQL5.7

Master: 192.168.162.134

From 1RV 192.168.162.133

From 2RV 192.168.162.135

Installation reference: http://liyingdi.blog.51cto.com/6397405/1879993

Master server configuration:

Server_id = 134# guarantee unique

Log-bin = mysql-bin # Open binlog

Gtid-mode = on # turn on gtid mode

Enforce-gtid-consistency=1 # enforces gtid consistency

two。 Restart the primary server and create a replication user.

Grant replication slave on *. * to 'rpl133'@'192.168.162.133' identified by' 123456'

Grant replication slave on *. * to 'rpl133'@'192.168.162.135' identified by' 123456'

3. Configure two slave servers

Server_id = 133If it's a 135server, it's 135,

Log-bin = mysql-bin

Whether log-slave-updates=true # slave updates are logged

Gtid-mode=on

Enforce-gtid-consistency=true

4 define the link to the master library on the slave library

Change master to master_host='192.168.162.134',master_user='rpl133',master_password='123456',MASTER_AUTO_POSITION=1

5. Start slave

6. test

PS: the building here is the most basic master and slave, and individuals can optimize various parameters according to their own production links.

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