MySQL Group Replication multi-machine multi-instance installation configuration (Windows environment)

1. Download mysql5.7.17   download address

 

2. Unzip the zip to the specified directory

 

The local installation directory is: D:\tools\mysql-5.7.17

 

 

3. Configure mysql environment variables

 

PATH=D:\tools\mysql-5.7.17\bin;$PATH

 Note: If mysql has been installed before, please uninstall and clear the registry information and mysql service link manually.

Check the registry information, WIN+R type: regedit, if it exists, please clear it.
View the service link, WIN+R type: services.msc
If it exists, type in the command window: sc delete MySQL

 

4. Configure hosts

 

10.10.1.17 node3-04 node3-04.novalocal lihua-pc
10.10.2.140 node3-05 node3-05.novalocal win7-64-PC
10.10.2.168 node3-06 node3-06.novalocal zyz-pc
 

 

5. Configure my.ini

 

[client]
default-character-set=utf8

[mysqld]
basedir = D:/tools/mysql-5.7.17
datadir = D:/tools/mysql-5.7.17/data
port = 3306
tmpdir   = D:/tools/mysql-5.7.17/tmp
socket   = D:/tools/mysql-5.7.17/mysql.sock
log-error= D:/tools/mysql-5.7.17/logs/mysql_error.log

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

#Replication Framework
server_id=4
gtid_mode=ON
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
binlog_checksum=NONE
log_slave_updates=ON
log_bin=D:/tools/mysql-5.7.17/logs/binlog
binlog_format=ROW
binlog_row_image=minimal
relay-log=D:/tools/mysql-5.7.17/logs/relay-bin

#Group Replication
transaction_write_set_extraction=XXHASH64
loose-group_replication_group_name="0374cfa3-deae-11e6-b0fe-fa163e2d23ab"
loose-group_replication_start_on_boot=off
loose-group_replication_local_address= "node3-04:24901"
loose-group_replication_group_seeds= "node3-04:24901,node3-05:24901,node3-06:24901"
loose-group_replication_bootstrap_group= off
loose-group_replication_single_primary_mode=FALSE
loose-group_replication_enforce_update_everywhere_checks=TRUE
 After my.ini is configured, it can be placed in the C:\Windows directory. The server_id and loose-group_replication_local_address corresponding to different machines here will be different .

 

 

6. Initialize the database

 

WIN+R Type: cmd
mysqld --initialize-insecure --user=mysql

 Note: If the mysql environment variable is not configured, or the mysql path is specified incorrectly, an error will be reported when the above command is executed on the command line.

 

 

7. Start the mysql service

 

mysqld install

 Then manually start the mysql service in services.msc, and adjust the mysql service to start manually if necessary.

 

 

8. Login and change password

 

#First login without password
mysql -uroot -p
#Modify root password
SET PASSWORD = PASSWORD('root');
flush privileges;

 

 

9. Create the users required for group replication

 

SET SQL_LOG_BIN=0;
CREATE USER rpl_user@'%';
GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%' IDENTIFIED BY 'rpl_pass';
FLUSH PRIVILEGES;
SET SQL_LOG_BIN=1;
CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='rpl_pass' FOR CHANNEL 'group_replication_recovery';

 

 

10. Install the group replication plugin

 

INSTALL PLUGIN group_replication SONAME 'group_replication.dll';
SHOW PLUGINS;

 

 

11. Start group replication

 

#Start group replication
SET GLOBAL group_replication_bootstrap_group=ON;
START GROUP_REPLICATION;
SET GLOBAL group_replication_bootstrap_group=OFF;
#View group member status
SELECT * FROM performance_schema.replication_group_members;

 

 

The following operations are not much different from those under linux, so I won’t repeat them here. For specific reference: MySQL Group Replication multi-machine multi-instance installation and configuration

 

over!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326451162&siteId=291194637