Innodb Cluster 入门(5) mysql组复制

Mysql 组复制

GTID
A global transaction identifier (GTID) is a unique identifier created and associated with each transaction committed on the server of origin (master). This identifier is unique not only to the server on which it originated, but is unique across all servers in a given replication setup. There is a 1-to-1 mapping between all transactions and all GTIDs.
这里写图片描述

GTID同步流程
这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述

搭建GTID Replication
1. 主从服务器同步
这里写图片描述
2.停止各服务器
3. 配置GTID并启动服务器
这里写图片描述
4. 切换master,并start slave
这里写图片描述
5. 取消只读
这里写图片描述

配置Group Replication Server
配置my.cnf:
server_id=x
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=mysql-bin
binlog_format=ROW

配置Group Replication
配置my.cnf:
这里写图片描述

创建复制用户
这里写图片描述
这里写图片描述

安装Group Replication插件
这里写图片描述

启动Group Replication
这里写图片描述

添加组成员
同一组内的成员服务器 start group_replication之后,自动加入。

查找Primary服务器
SELECT VARIABLE_VALUE
FROM performance_schema.global_status
WHERE VARIABLE_NAME= ‘group_replication_primary_member’;

SELECT * FROM performance_schema.replication_group_members;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值