###mysql mgr 多主模式配置
环境说明
1)mysql8.0,mgr模式正确启动(任意节点做DDL,DML操作,其他节点都可以正确查看)
2)mgr模式正确启动,如下图所示

3)其中一个节点的my.cnf内容,其中与软件相关的参数server-id值需要记录
[root@zbomc2 bin]# more ../my.cnf
[client]
default-character-set=utf8
socket=/mysql-8.0.11/data/mysql.sock

[mysqld]
user = mysql
port = 4306
basedir=/mysql-8.0.11/
datadir=/mysql-8.0.11/data
socket=/mysql-8.0.11/data/mysql.sock

symbolic-links=0
lower_case_table_names = 1
server-id = 183308
log-bin = mysql-bin
log-bin-index = binlogs.index
binlog_format = row
binlog_rows_query_log_events = on
binlog_checksum = none
slave-parallel-type = LOGICAL_CLOCK
slave-parallel-workers = 4
slave_preserve_commit_order = 1

gtid_mode = on
enforce_gtid_consistency = 1
log-slave-updates = 1
binlog_gtid_simple_recovery = 1
relay_log = /mysql-8.0.11/data/relay.log
relay-log-index = /mysql-8.0.11/data/relay.index
master_info_repository = table
relay_log_info_repository = table

transaction_write_set_extraction = XXHASH64 #对每个事务获取write set,并且用XXHASH64算法获取hash值
loose-group_replication_group_name = “aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa” #组名,此处可拿select.uuid()生成
loose-group_replication_start_on_boot = off #在mysqld启动时不自动启动组复制
loose-group_replication_local_address = “172.17.104.186:33006” #本节点的IP地址和端口,注意该端口是组内成员之间通信的端口,而不是MySQL对外提供服务的端口
loose-group_replication_group_seeds = “172.17.104.186:33006,172.17.104.184:33006,172.17.46.243:33006”
loose-group_replication_bootstrap_group = off #关闭,如果打开会造成脑裂 #是否启动集群,注意,该选项任何时候只能用于一个节点,通常情况下启动集群的时候使用,启动之后需要关闭该选项
loose-group_replication_member_weight = 50 #权重选择
loose-group_replication_single_primary_mode=FALSE
loose-group_replication_enforce_update_everywhere_checks= TRUE
group_replication_ip_whitelist=172.17.104.184,172.17.104.186,172.17.46.243

skip-host-cache
skip-name-resolve
skip-external-locking
character-set-server=utf8
lower_case_table_names=1
event_scheduler=on
log_bin_trust_function_creators=on
external-locking = FALSE
thread_cache_size = 300
innodb_log_files_in_group = 2
innodb_flush_log_at_trx_commit = 1
sync_binlog = 1

[mysqld_safe]
log-error=/mysql-8.0.11/data/mysqld.log
~

###zcbus软件配置点
1)三个节点任意找一个主键点,其他节点作为辅助节点,在primary_Nodeid参数里面添加主节点的nodeid值

2)三个节点启动过程中,作为辅助节点的全量发布进程无法启动,是正常的
3)sync_serverid配置成my.cnf里面的server-id值

#测试过程
1)三个节点做任意操作,其他节点real日志可以看到过滤的其他节点操作信息
2)当三个节点任意一个节点异常后,软件可以继续分析增量数据并把整理数据同步到目标端

文档更新时间: 2021-07-10 14:45   作者:刘志伟