MySQL MGR - MGR deployment

MGR deployment

Scene Description:

Use three servers to build a simple MGR cluster using MySQL 5.7.24 version, the server list is:

192.168.1.147
192.168.1.148
192.168.1.149

 

1, using the common configuration file to start the MySQL service, MGR plug-in installation (performing all nodes)

INSTALL PLUGIN group_replication SONAME 'group_replication.so';

 

2, MySQL adjust each node configuration file and restart the MySQL service (all nodes perform)

## config master
server-id               				= 17218228149
log-bin                 				= mysql-bin
master_info_repository  				= TABLE
binlog_format           				= ROW
expire_logs_days        				= 7
sync_binlog             				= 1
gtid_mode                				= on
enforce-gtid-consistency 				= true
binlog_rows_query_log_events 			        = on
binlog_checksum                         = NONE ## config slave skip-slave-start slave-parallel-workers = 8 slave-parallel-type = LOGICAL_CLOCK slave_preserve_commit_order = 1 log_slave_updates = 1 report_host = 192.168.1.149 ## config relay log relay-log = relay-log relay_log_recovery = ON sync_relay_log = 0 relay_log_info_repository = TABLE ## config group replication transaction_write_set_extraction    = XXHASH64 loose-group_replication_group_name    = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa01" loose-group_replication_start_on_boot         = OFF loose-group_replication_bootstrap_group         = OFF loose-group_replication_local_address         = "192.168.1.149:33581" loose-group_replication_group_seeds    = "192.168.1.147:33581,192.168.1.148:33581,192.168.1.149:33581" loose-group_replication_ip_whitelist         = "192.168.1.147,192.168.1.148,192.168.1.149"

MGR plug-in is not installed before adding MGR configuration will get an error in the configuration file.

MGR configuration instructions: above the yellow part of many parameters not mentioned in the configuration file, but is likely to lead to deployment failure, especially loose-group_replication_ip_whitelist parameters.

 

3, configuration MGR communication account, and clean up the MASTER (all nodes perform)

CREATE USER repl@'%' IDENTIFIED BY 'repl';
GRANT REPLICATION SLAVE ON *.* TO repl@'%';
RESET MASTER;

 

4, create MGR dependent replication environment (perform all nodes)

CHANGE MASTER TO MASTER_USER='repl', 
MASTER_PASSWORD='repl'
FOR CHANNEL 'group_replication_recovery';

 

5, on the master node starts MGR (executed on node 192.168.1.147)

SET GLOBAL group_replication_bootstrap_group=ON;
START group_replication;
SET GLOBAL group_replication_bootstrap_group=off;

 

6, MGR started on the secondary node (node ​​192.168.1.148 and executed on a node 192.168.1.149)

START group_replication;

 

7, after the building is complete, you can use the following statement to view the status:

View status of each node ## 
the SELECT * 
the FROM performance_schema.replication_group_members; 

## MGR see the current mode (single-master or multi-master) 
the SELECT @@ group_replication_single_primary_mode;

 

Guess you like

Origin www.cnblogs.com/gaogao67/p/11199360.html