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

3.2.5 在新回的实例上查看数据库发现test库和t1表已经同步

mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | | test | +--------------------+ 5 rows in set (0.00 sec) mysql> use test; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> show tables; +----------------+ | Tables_in_test | +----------------+ | t1 | +----------------+ 1 row in set (0.00 sec) mysql> select * from t1; +----+------+ | c1 | c2 | +----+------+ | 1 | Luis | +----+------+ 1 row in set (0.00 sec)

3.3 以同样方法添加uranus.mgr.com

详细步骤请参考3.2, 这里只给出配置文件/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 = 183 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 = 'uranus.mgr.com:33063' loose-group_replication_group_seeds ='apollo.mgr.com:33061,artemis.mgr.com:33062,uranus.mgr.com:33063' loose-group_replication_bootstrap_group = off

3.4 查看复制组状态 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 | | group_replication_applier | f2ca816c-1c72-11e7-a1aa-080027eaa4e1 | uranus.mgr.com | 3306 | ONLINE | +---------------------------+--------------------------------------+-----------------+-------------+--------------+

本文永久更新链接地址

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

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