MySQL5.7 Group Replication (MGR) 集群搭建(4)

3.2 复制组添加新实例artemis.mgr.com 3.2.1 修改/etc/my.cnf 配置文件,方法和之前相同 # For advice on how to change settings please see # [mysqld] # # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid # Group Replication server_id = 182 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 = 'ce9be252-2b71-11e6-b8f4-00212844f856' loose-group_replication_start_on_boot = off loose-group_replication_local_address = 'artemis.mgr.com:33062' loose-group_replication_group_seeds ='apollo.mgr.com:33061,artemis.mgr.com:33062,uranus.mgr.com:33063' loose-group_replication_bootstrap_group = off

3.2.2 用户凭证 mysql> set SQL_LOG_BIN=0; Query OK, 0 rows affected (0.00 sec) mysql> create user repl@'%' identified by 'Love88me=-.,'; Query OK, 0 rows affected (0.00 sec) mysql> grant replication slave on *.* to repl@'%'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> SET SQL_LOG_BIN=1; Query OK, 0 rows affected (0.00 sec) mysql> change master to master_user='repl',master_password='Love88me=-.,' for channel 'group_replication_recovery'; Query OK, 0 rows affected, 2 warnings (0.02 sec) -- 安装group replication插件 mysql> install PLUGIN group_replication SONAME 'group_replication.so'; Query OK, 0 rows affected (0.00 sec) 3.2.3 把实例添回到之前的复制组 mysql> set global group_replication_allow_local_disjoint_gtids_join=ON; Query OK, 0 rows affected (0.00 sec) mysql> start group_replication; Query OK, 0 rows affected (6.65 sec)

3.2.4 在apollo.mgr.com上查看复制组状态 mysql> select * from performance_schema.replication_group_members; +---------------------------+--------------------------------------+-----------------+-------------+--------------+ | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | +---------------------------+--------------------------------------+-----------------+-------------+--------------+ | group_replication_applier | ecf48652-1c72-11e7-a7c1-08002785d027 | apollo.mgr.com | 3306 | ONLINE | | group_replication_applier | f0a20978-1c72-11e7-a17b-0800272ce349 | artemis.mgr.com | 3306 | ONLINE | +---------------------------+--------------------------------------+-----------------+-------------+--------------+

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/60c44045b44f7ddebe96b40d47f6081b.html