MSYQL Full Sync

Source: Internet
Author: User

Environment: rhel6.5 Server7server8server9 #清空节点数据库数据, re-initialize
[Email protected] ~]# Cd/var/lib/mysql
[Email protected] mysql]# RM-FR *
[Email protected] ~]# Uuidgen
78030800-2ca8-4085-99ec-91099dbbde45
[Email protected] ~]# VIM/ETC/MY.CNF
Server_id=1

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=binlog
Binlog_format=row

Transaction_write_set_extraction=xxhash64
Loose-group_replication_group_name= "78030800-2ca8-4085-99ec-91099dbbde45" #注意三个节点uuid一致否则START group_ Replication not come, become a single node
Loose-group_replication_start_on_boot=off
loose-group_replication_local_address= "172.25.135.7:24901" #各自改为节点IP
Loose-group_replication_group_seeds= "172.25.135.7:24901,172.25.135.8:24901,172.25.135.9:24901"
Loose-group_replication_bootstrap_group=off
Loose-group_replication_ip_whitelist= "172.25.135.0/24"
Loose-group_replication_enforce_update_everywhere_checks=on
Loose-group_replication_single_primary_mode=off

[[email protected] ~]#/etc/init.d/mysqld start
Initializing MySQL database: [OK]
Installing Validate Password plugin: [OK]
Starting mysqld: [OK]
[[email protected] ~]# grep password/var/log/mysqld.log
[Email protected] ~]# mysql_secure_installation #初始化
[email protected] ~]# MySQL [email protected]
Mysql> SET sql_log_bin=0;
Mysql> GRANT REPLICATION SLAVE on.to [email protected] '% ' identified by ' [email protected] '
;
mysql> FLUSH privileges;
mysql> Reset Master;
Mysql> SET sql_log_bin=1;
mysql> change MASTER to master_user= ' Rpl_user ', master_password= ' [e-mail protected] ' for CHANNEL ' Group_replication_ Recovery ';
mysql> INSTALL PLUGIN group_replication SONAME ' group_replication.so ';
Mysql> SHOW PLUGINS;
mysql> set global group_replication_bootstrap_group=on;
mysql> start group_replication;
mysql> set global Group_replication_bootstrap_group=off;
Mysql> SELECTFrom Performance_schema.replication_group_members;

mysql> CREATE DATABASE test;
mysql> use test;
mysql> INSERT INTO T1 values (1, ' Luis ');
Mysql> Select
from T1;
+----+------+
| C1 | C2 |
+----+------+
| 1 | Luis |
+----+------+
1 row in Set (0.00 sec)
[email protected] ~]# MySQL [email protected]
Mysql> SET sql_log_bin=0;
Mysql> GRANT REPLICATION SLAVE on.to [email protected] '% ' identified by ' [email protected] '
;
mysql> FLUSH privileges;
mysql> Reset Master;
Mysql> SET sql_log_bin=1;
mysql> change MASTER to master_user= ' Rpl_user ', master_password= ' [e-mail protected] ' for CHANNEL ' Group_replication_ Recovery ';
Mysql> SHOW PLUGINS;
Mysql> START group_replication;
Mysql> SELECT * from Performance_schema.replication_group_members;
Server8 and Server9 consistent configuration: status online is OK

MSYQL Full Sync

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.