MySQL GROUP_replication????????????

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL GROUP_replication????????????相关的知识,希望对你有一定的参考价值。

???????????????   tran   sql   ??????   global   server   replicat   bootstra   17.   

1??????Replication Server??????

[mysqld]

# server configuration

datadir=<full_path_to_data>/data/s1

basedir=<full_path_to_bin>/mysql-8.0/

port=24801

socket=<full_path_to_sock_dir>/s1.sock

??????

?????????????????????24801??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

 

2?????????????????????

???my.cnf??????[mysqld]?????????????????????

server_id=1

gtid_mode=ON

enforce_gtid_consistency=ON

binlog_checksum=NONE

log_bin=binlog

log_slave_updates=ON

binlog_format=ROW

master_info_repository=TABLE

relay_log_info_repository=TABLE

 

3??????????????????

transaction_write_set_extraction=XXHASH64

loose-group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"            

loose-group_replication_start_on_boot=off

loose-group_replication_local_address= "188.102.17.179:2525"

loose-group_replication_group_seeds= "188.102.17.179:2525,188.102.17.180:2525,188.102.4.131:2525"

loose-group_replication_bootstrap_group=off

 

?????????

????????????????????????????????????????????????????????????????????????loose-?????? ????????? group_replication??????????????????????????????

?????? transaction_write_set_extraction

??????????????????????????????????????????????????????????????????XXHASH64???????????????????????????????????????MySQL 8.0.2???????????????????????????????????????????????????????????????

?????? group_replication_group_name

??????????????????UUID????????????????????????????????????????????????GTID???????????????????????????UUID?????????SELECT UUID()????????????UUID???

?????? group_replication_start_on_boot

??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

?????????????????????????????? group_replication_start_on_boot ???on??????????????????????????????????????????Group Replication???

?????? group_replication_local_address

????????????????????????????????????127.0.0.1?????????24901?????????????????????????????????????????????

??????

????????????????????????????????????XCom?????????????????????????????????????????????????????????SQL????????????????????????????????????????????????????????????????????????

???????????????????????????????????????????????????????????????????????????

????????????????????? group_replication_local_address

?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????IP?????????10.0.0.1???

?????????????????????????????????????????????????????????????????????????????????DNS??????????????????/etc/hosts ????????????????????????????????????????????????

??????????????? group_replication_local_address ???33061.????????????????????????????????????????????????????????????????????????????????????????????????24901???24903?????????????????????????????????

?????? group_replication_group_seeds

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? performance_schema.replication_group_members???

?????????group_replication_group_seeds ????????????hostname:port???????????????????????? group_replication_local_address???????????????????????????????????????????????????????????????????????????

????????????hostname:port?????? group_replication_group_seeds ??????????????????????????????????????????????????? group_replication_local_address ???

?????????SQL hostname:port????????????????????????????????????????????? performance_schema.replication_group_members ?????????

 

4?????????????????????

1????????????????????????

???????????????????????????????????????????????????????????????????????????????????????

SET SQL_LOG_BIN=0;????????????

CREATE USER [email protected]???%??? IDENTIFIED BY ???password???;

GRANT REPLICATION SLAVE ON *.* TO [email protected]???%???;

FLUSH PRIVILEGES;

SET SQL_LOG_BIN=1;????????????

CHANGE MASTER TO MASTER_USER=???repli???, MASTER_PASSWORD=???[email protected]%??? FOR CHANNEL ???group_replication_recovery???;

 

2?????????????????????

INSTALL PLUGIN group_replication SONAME ???group_replication.so???;

3??????????????????????????????????????????

SHOW PLUGINS; 

show global variables like ???group_replication_ip_whitelist???;

SET GLOBAL group_replication_ip_whitelist="188.102.17.179,188.102.17.180,188.102.4.131";

?????????????????????????????????????????????????????????

4????????????????????????

SET GLOBAL group_replication_bootstrap_group=ON;   ?????????????????????????????????????????????????????????

START GROUP_REPLICATION;

SET GLOBAL group_replication_bootstrap_group = OFF; ?????????????????????????????????????????????????????????

???????????????????????????

SELECT * FROM performance_schema.replication_group_members;

 ??????????????????

???????????????????????????

select * from performance_schema.replication_connection_statusG

 

 

5?????????

????????????

CREATE DATABASE test;

USE test;

CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 TEXT NOT NULL);

INSERT INTO t1 VALUES (1, ???Luis???);

SELECT * FROM t1;

SHOW BINLOG EVENTS;

 ??????????????????

??????????????????

 

????????????

show databases;

use test

show tables;

select * from t1;

??????????????????

 

以上是关于MySQL GROUP_replication????????????的主要内容,如果未能解决你的问题,请参考以下文章

Plugin ‘group_replication‘ is not loaded

InnoDB Cluster addInstance:插件 group_replication 报告:“读取失败”

『叶问』#39,都有哪些情况可能导致MGR服务无法启动

MySQL

mysql初学,mysql修改,mysql查找,mysql删除,mysql基本命令

mysql(设置/更改mysql密码,连接MySQL,MySQL常用命令,MySQL两种引擎区别)