In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly tells you how to configure and start the Primay Server of the Mysql group replication cluster. You can check the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here. Let's go straight to the topic. I hope this article will give you some practical help on how to configure and start the Primay Server of the Mysql group replication cluster.
First, add group replication to the configuration file
Server_id=1
# GTID mode is on. Global Transaction Identifier global transaction identification
# A GTID is executed only once on a CVM to avoid data confusion or inconsistency caused by repeated execution
Gtid_mode=ON
Enforce_gtid_consistency=ON
# these two parameters save master.info and relay.info in the table
# master.info, relay.info to generate information during data replication
Master_info_repository=TABLE
Relay_log_info_repository=TABLE
# use binlog binary logging technology when replicating data synchronously. Related configuration of binlog
Binlog_checksum=NONE
Log_slave_updates=ON
Log_bin=binlog
Binlog_format=ROW
# the following is for configuration replication
Transaction_write_set_extraction=XXHASH64
The format of # roup_name is UUID, and you can execute select uuid () in MySQL to get a
Loose-group_replication_group_name=056dc8f1-3007-11e7-bcbe-f079598d6322
# do not start group replication automatically when starting
Loose-group_replication_start_on_boot=off
# the port used by this server to communicate and copy with other team members
# if each server instance runs on a different machine, it is officially recommended that the port of this address be 33061
Loose-group_replication_local_address= "127.0.0.1purl 33061"
# seed member list, which is the other team members that server can contact when joining the group.
# this option does not need to list all group members. You need to join the server of the group. You only need to ask one member of the group to join the group.
# it is not supported to join multiple members at the same time when creating a group, which will cause competition
# Warining, the server started first in the group, does not use this option
Loose-group_replication_group_seeds= "127.0.0.1 33061127.0.0.1" 33071127.0.1 "
# this option ON can only be used on one server instance at any time. If more than one is ON, it will cause brain fissure.
# this option is manually set to ON when group launches server and builds startup group
# after server is started, use the command line SET loose-group_replication_bootstrap_group=ON
Loose-group_replication_bootstrap_group=off
two. Start the primary Server and create a group
Group replication mechanism, using asynchronous replication protocol to replicate data in distributed cluster instances. The distributed recovery process relies on a channel called "group_replication_recovery", which is used to transfer things among group members. Here, we need to configure the correct users and establish a direct replication channel between group members based on the group replication mechanism.
So, first create a user with replication_slave privileges
In the initial sever, execute the following command to build the user and authorize the use of the recovery channel
-- set the following actions not to log
Set sql_log_bin=0
Create user rpl_user@'%'
Grant replication slave on *. * to rpl_user@'%' identified by 'Abcd1234'
Flush privileges
Set sql_log_bin=1
The following sentence may be too long, separate two lines of input (do not take it at the end of the first line;)
-- use change master to to configure this server to use the credentials given by the group_replication_recovery channel when recovering data from other group members.
Change master to master_user='rpl_user', master_password='Abcd1234'
For channel 'group_replication_recovery'
# you can check with the following statement
Select * from mysql.slave_master_info\ G
Install the group replication plug-in
Use the following LINUX
Install plugin group_replication soname 'group_replication.so'
Use under windows
Install plugin group_replication soname 'group_replication.dll'
You can check whether the installation is successful through the show plugins command
Start the replication group
The entire replication group only needs to be started once.
Set global group_replication_bootstrap_group=ON
Start group_replication
Set global group_replication_bootstrap_group=OFF
After starting successfully, you can check whether the first member has joined the group with the following statement
Select * from performance_schema.replication_group_members
Mysql group replication cluster how to configure and start the Primay Server to tell you here, for other related issues you want to know can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.