MySQL Group Replication mgr 安装关键过程
发表于:2024-11-19 作者:千家信息网编辑
千家信息网最后更新 2024年11月19日,1、初始化和启动mysql/bin/mysqld --initialize-insecure --basedir=/mgr/mysql --datadir=/mgr/data/s1mysql/bin/
千家信息网最后更新 2024年11月19日MySQL Group Replication mgr 安装关键过程
1、初始化和启动
mysql/bin/mysqld --initialize-insecure --basedir=/mgr/mysql --datadir=/mgr/data/s1mysql/bin/mysqld --initialize-insecure --basedir=/mgr/mysql --datadir=/mgr/data/s2mysql/bin/mysqld --initialize-insecure --basedir=/mgr/mysql --datadir=/mgr/data/s3/mgr/mysql/bin/mysqld --defaults-file=/mgr/data/s1/s1.cnf/mgr/mysql/bin/mysqld --defaults-file=/mgr/data/s2/s2.cnf/mgr/mysql/bin/mysqld --defaults-file=/mgr/data/s3/s3.cnf
2、配置文件具体内
s1:[mysqld]# server configurationdatadir=/mgr/data/s1basedir=/mgr/mysql/user=mysqlport=24801socket=/mgr/data/s1/s1.sock#disabled_storage_engines="MyISAM,BLACKHOLE,FEDERATED,ARCHIVE,MEMORY"#Replication Frameworkserver_id=1gtid_mode=ONenforce_gtid_consistency=ONmaster_info_repository=TABLErelay_log_info_repository=TABLEbinlog_checksum=NONElog_slave_updates=ONlog_bin=binlogbinlog_format=ROW#Group Replication Settingstransaction_write_set_extraction=XXHASH64loose-group_replication_group_name="5c7975ec-0000-11e9-a8c9-0800273906ff"loose-group_replication_start_on_boot=offloose-group_replication_local_address= "127.0.0.1:24901"loose-group_replication_group_seeds= "127.0.0.1:24901,127.0.0.1:24902,127.0.0.1:24903"loose-group_replication_bootstrap_group=offs2:[mysqld]# server configurationdatadir=/mgr/data/s2basedir=/mgr/mysql/user=mysqlport=24802socket=/mgr/data/s2/s2.sock#disabled_storage_engines="MyISAM,BLACKHOLE,FEDERATED,ARCHIVE,MEMORY"#Replication Frameworkserver_id=2gtid_mode=ONenforce_gtid_consistency=ONmaster_info_repository=TABLErelay_log_info_repository=TABLEbinlog_checksum=NONElog_slave_updates=ONlog_bin=binlogbinlog_format=ROW#Group Replication Settingstransaction_write_set_extraction=XXHASH64loose-group_replication_group_name="5c7975ec-0000-11e9-a8c9-0800273906ff"loose-group_replication_start_on_boot=offloose-group_replication_local_address= "127.0.0.1:24902"loose-group_replication_group_seeds= "127.0.0.1:24901,127.0.0.1:24902,127.0.0.1:24903"loose-group_replication_bootstrap_group=offs3:[mysqld]# server configurationdatadir=/mgr/data/s3basedir=/mgr/mysql/user=mysqlport=24803socket=/mgr/data/s3/s3.sock#disabled_storage_engines="MyISAM,BLACKHOLE,FEDERATED,ARCHIVE,MEMORY"#Replication Frameworkserver_id=3gtid_mode=ONenforce_gtid_consistency=ONmaster_info_repository=TABLErelay_log_info_repository=TABLEbinlog_checksum=NONElog_slave_updates=ONlog_bin=binlogbinlog_format=ROW#Group Replication Settingstransaction_write_set_extraction=XXHASH64loose-group_replication_group_name="5c7975ec-0000-11e9-a8c9-0800273906ff"loose-group_replication_start_on_boot=offloose-group_replication_local_address= "127.0.0.1:24903"loose-group_replication_group_seeds= "127.0.0.1:24901,127.0.0.1:24902,127.0.0.1:24903"loose-group_replication_bootstrap_group=off
3、登录MySQL执行命令
s1必要过程mysql> SET SQL_LOG_BIN=0;mysql> CREATE USER rpl_user@'%' IDENTIFIED BY 'password';mysql> GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%';mysql> FLUSH PRIVILEGES;mysql> SET SQL_LOG_BIN=1;mysql> CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='password' FOR CHANNEL 'group_replication_recovery';mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';mysql> SET GLOBAL group_replication_bootstrap_group=ON;mysql> START GROUP_REPLICATION;mysql> SET GLOBAL group_replication_bootstrap_group=OFF;s1非必要过程mysql> SELECT * FROM performance_schema.replication_group_members;mysql> SHOW PLUGINS; mysql> CREATE DATABASE test;mysql> USE test;mysql> CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 TEXT NOT NULL);mysql> INSERT INTO t1 VALUES (1, 'Luis');mysql> SELECT * FROM t1;mysql> SHOW BINLOG EVENTS;mysql> exits2必要过程mysql> SET SQL_LOG_BIN=0;mysql> CREATE USER rpl_user@'%' IDENTIFIED BY 'password';mysql> GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%';mysql> FLUSH PRIVILEGES;mysql> SET SQL_LOG_BIN=1;mysql> CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='password' FOR CHANNEL 'group_replication_recovery';mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';mysql> SELECT * FROM performance_schema.replication_group_members;mysql> START GROUP_REPLICATION;mysql> SELECT * FROM performance_schema.replication_group_members;mysql> show variables like '%read_only%';s3必要过程mysql> SET SQL_LOG_BIN=0;mysql> CREATE USER rpl_user@'%' IDENTIFIED BY 'password';mysql> GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%';mysql> FLUSH PRIVILEGES;mysql> SET SQL_LOG_BIN=1;mysql> CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='password' FOR CHANNEL 'group_replication_recovery';mysql> INSTALL PLUGIN group_replication SONAME 'group_replication.so';mysql> SELECT * FROM performance_schema.replication_group_members;mysql> START GROUP_REPLICATION;mysql> SELECT * FROM performance_schema.replication_group_members;mysql> show variables like '%read_only%';
4、遇到问题
问题1[ERROR] unknown variable 'group_replication_group_name=5c7975ec-0000-11e9-a8c9-0800273906ff'原参数group_replication_group_name="5c7975ec-0000-11e9-a8c9-0800273906ff"group_replication_start_on_boot=offgroup_replication_local_address= "127.0.0.1:24903"group_replication_group_seeds= "127.0.0.1:24901,127.0.0.1:24902,127.0.0.1:24903"group_replication_bootstrap_group=off修改后参数 loose-group_replication_group_name="5c7975ec-0000-11e9-a8c9-0800273906ff"loose-group_replication_start_on_boot=offloose-group_replication_local_address= "127.0.0.1:24903"loose-group_replication_group_seeds= "127.0.0.1:24901,127.0.0.1:24902,127.0.0.1:24903"loose-group_replication_bootstrap_group=off问题2创建的复制用户和使用的复制用户不一致mysql> SELECT * FROM performance_schema.replication_group_members;+---------------------------+--------------------------------------+-------------+-------------+--------------+| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |+---------------------------+--------------------------------------+-------------+-------------+--------------+| group_replication_applier | 5c7975ec-a9cd-11e9-a8c9-0800273906ff | mgr1 | 24801 | ONLINE || group_replication_applier | 69908c35-a9cd-11e9-8b78-0800273906ff | mgr1 | 24802 | RECOVERING |+---------------------------+--------------------------------------+-------------+-------------+--------------+原:CHANGE MASTER TO MASTER_USER='repli', MASTER_PASSWORD='repli@%' FOR CHANNEL 'group_replication_recovery';修改后,要和创建的复制用户一致CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='password' FOR CHANNEL 'group_replication_recovery';问题3 未执行START GROUP_REPLICATION; 新加入节点显示offlinemysql> SELECT * FROM performance_schema.replication_group_members;+---------------------------+-----------+-------------+-------------+--------------+| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |+---------------------------+-----------+-------------+-------------+--------------+| group_replication_applier | | | NULL | OFFLINE |+---------------------------+-----------+-------------+-------------+--------------+1 row in set (0.00 sec)执行后mysql> START GROUP_REPLICATION;Query OK, 0 rows affected (3.47 sec)mysql> SELECT * FROM performance_schema.replication_group_members;+---------------------------+--------------------------------------+-------------+-------------+--------------+| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |+---------------------------+--------------------------------------+-------------+-------------+--------------+| group_replication_applier | 5c7975ec-a9cd-11e9-a8c9-0800273906ff | mgr1 | 24801 | ONLINE || group_replication_applier | 69908c35-a9cd-11e9-8b78-0800273906ff | mgr1 | 24802 | ONLINE || group_replication_applier | 79ca1c48-a9cd-11e9-9526-0800273906ff | mgr1 | 24803 | ONLINE |+---------------------------+--------------------------------------+-------------+-------------+--------------+3 rows in set (0.00 sec)
过程
必要
问题
用户
一致
参数
命令
文件
节点
登录
配置
关键
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
数据库第二版试卷
全球网络安全资讯
深圳工厂软件开发人员
成都c语言软件开发哪家专业
中国农业银行鲲鹏服务器
网络技术股市
网络安全王俊卿
水晶之牙是什么服务器
服务器的股票
掌盟怎么查一个人不同服务器的战绩
数据库项目人数
我的世界基岩版服务器推荐网站
是人工智能好还是软件开发好
使命召唤手游服务器维修公告
西贝街软件开发有限公司
24小时开机的服务器能做点什么
liunx 备份数据库
如何关闭共享打印服务器
网络数据库盗取Cookie
苏州节能刀片服务器设计
软件开发师可以挂吗
网易号网络安全
徐汇区电子软件开发大概费用
网络安全和应急管理局是干嘛的
数据库开发过程文档
北京米洛网络技术
公司软件开发预付款多少合适
青浦区工业网络技术常见问题
女生怎样学习网络安全
广东数据网络技术开发诚信互利