In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
How to build MySQL5.7.17- Group Replication, in view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Background:
Mysql > INSTALL PLUGIN group_replication SONAME 'group_replication.so'
Mysql > SHOW PLUGINS +-- +-- +-+ | Name | Status | Type | | Library | License | +-- +-- +-+ | binlog | | | ACTIVE | STORAGE ENGINE | NULL | PROPRIETARY | (...) | group_replication | ACTIVE | GROUP REPLICATION | group_replication.so | PROPRIETARY | +-+-| -+
Mysql > SET GLOBAL group_replication_bootstrap_group=ON
Mysql > START GROUP_REPLICATION
Mysql > SET GLOBAL group_replication_bootstrap_group=OFF
Mysql > SELECT * FROM performance_schema.replication_group_members
+-+
| | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | |
+-+
| | group_replication_applier | 550a7cbd-ccce-11e6-829a-a2d813521b2e | sh347 | 3307 | ONLINE | |
+-+
1 row in set (0.00 sec)
2.4 insert some simulation data
Mysql > CREATE DATABASE test
Query OK, 1 row affected (0.00 sec)
Mysql > use test
Database changed
Mysql > CREATE TABLE T1 (C1 INT PRIMARY KEY, c2 TEXT NOT NULL)
Query OK, 0 rows affected (0.00 sec)
Mysql > INSERT INTO T1 VALUES (1, 'Luis')
Query OK, 1 row affected (0.01sec)
3 add database instances to the cluster
3.1 modify the configuration file of the second database
[client]
Port = 24802
Socket = / home/data/mydata/3307/mysql.sock
[mysqld]
Port = 24802
Socket = / home/data/mydata/3307/mysql.sock
Basedir = / home/data/mysql
Datadir = / home/data/mydata/3307
Pid-file = / home/data/mydata/3307/mysql.pid
# # group replication####
Server_id = 2
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 = "77e497e2-c59a-11e6-9a68-525400159185"
Loose-group_replication_start_on_boot=off
Loose-group_replication_local_address= "192.168.1.14purl 34062"
Loose-group_replication_group_seeds= "192.168.1.247" 34061192.168.1.14 "34062192.168.1.242"
Loose-group_replication_bootstrap_group=off
Loose-group_replication_single_primary_mode=false
Loose-group_replication_enforce_update_everywhere_checks=TRUE
3.2 start the database for configuration
SET SQL_LOG_BIN=0
CREATE USER rpl_user@'%'
GRANT REPLICATION SLAVE ON *. * TO rpl_user@'%' IDENTIFIED BY 'rpl_pass'
SET SQL_LOG_BIN=1
CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='rpl_pass' FOR CHANNEL 'group_replication_recovery'
Install the engine and join the gp group
Mysql > INSTALL PLUGIN group_replication SONAME 'group_replication.so'
Mysql > START GROUP_REPLICATION
Mysql > SELECT * FROM performance_schema.replication_group_members
+-+
| | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | |
+-+
| | group_replication_applier | 29a03be3-cccf-11e6-9dac-00163e2d2c29 | interface.test.haodai.com | 24802 | ONLINE | |
| | group_replication_applier | 550a7cbd-ccce-11e6-829a-a2d813521b2e | sh347 | 3307 | ONLINE | |
+-+
Note: compared with the 2 operation, there are two less steps, do not perform those two steps! Those two steps are the two steps that need to be performed only when setting up gp initialization.
3.4 Inspection data
Mysql > show databases
+-+
| | Database |
+-+
| | information_schema |
| | mysql |
| | performance_schema |
| | sys |
| | test |
+-+
5 rows in set (0.00 sec)
Mysql > select * from test.t1
+-+ +
| | C1 | c2 |
+-+ +
| | 1 | Luis |
+-+ +
1 row in set (0.00 sec)
4 analog database downmachine
Shut down the 247 database
Mysql > 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; # reopen it
Query OK, 0 rows affected (3.50 sec)
Mysql > SELECT * FROM performance_schema.replication_group_members
| | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | |
| | group_replication_applier | 29a03be3-cccf-11e6-9dac-00163e2d2c29 | interface.test.haodai.com | 24802 | ONLINE | |
| | group_replication_applier | 550a7cbd-ccce-11e6-829a-a2d813521b2e | sh347 | 3307 | ONLINE | |
2 rows in set (0.00 sec)
Mysql > stop GROUP_REPLICATION
Query OK, 0 rows affected (8.47 sec)
Mysql > SELECT * FROM performance_schema.replication_group_members
| | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | |
| | group_replication_applier | 550a7cbd-ccce-11e6-829a-a2d813521b2e | sh347 | 3307 | OFFLINE | |
1 row in set (0.00 sec)
Mysql > start GROUP_REPLICATION
Query OK, 0 rows affected (5.49 sec)
Mysql > SELECT * FROM performance_schema.replication_group_members
| | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | |
| | group_replication_applier | 29a03be3-cccf-11e6-9dac-00163e2d2c29 | interface.test.haodai.com | 24802 | ONLINE | |
| | group_replication_applier | 550a7cbd-ccce-11e6-829a-a2d813521b2e | sh347 | 3307 | ONLINE | |
2 rows in set (0.00 sec)
At this point, the database cluster has been built!
This is the answer to the question on how to build MySQL5.7.17- Group Replication. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel to learn more about it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 255
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
SQL > set lines 200SQL > select * from v$version where rownum=1;BANNER
© 2024 shulou.com SLNews company. All rights reserved.