Build MySQL 8.0 Group Replication

Source: Internet
Author: User


1, modify the configuration file, add the following content

Server_id=1

Gtid_mode=on

Enforce_gtid_consistency=on

Binlog_checksum=none

Transaction_write_set_extraction=xxhash64

Loose-group_replication_group_name= "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"

Loose-group_replication_start_on_boot=off

Loose-group_replication_local_address= "192.168.1.249:24901"

Loose-group_replication_group_seeds= "192.168.1.249:24901,192.168.1.252:24901,192.168.1.253:24901"

Loose-group_replication_bootstrap_group=off

Loose-group_replication_ip_whitelist= "192.168.1.0/24"

# each node server_id, loose-group_replication_local_address value is not the same, according to the IP to make the corresponding changes


2. Add System name Mappings

192.168.1.249 Kuber01

192.168.1.252 Kuber02

192.168.1.253 kuber03


3, create the account Rpl_user, each node needs to create

SET sql_log_bin=0;

alter user [email protected] ' localhost ' identified by ' MySQL8.0 ';

CREATE USER [email protected] '% ' identified by ' MySQL8.0 ';

GRANT REPLICATION SLAVE On * * to [email protected] '% ';

FLUSH privileges;

SET sql_log_bin=1;


4. Add nodes to the cluster

Change MASTER to Master_user= ' Rpl_user ', master_password= ' MySQL8.0 ' for CHANNEL ' group_replication_recovery ';


5, install the plug-in

INSTALL PLUGIN group_replication SONAME ' group_replication.so ';


6. Start the node

# Start the first node

SET GLOBAL Group_replication_bootstrap_group=on;

START group_replication;

SET GLOBAL Group_replication_bootstrap_group=off;

# Start Other nodes

START group_replication;


7. Query cluster members

SELECT * from Performance_schema.replication_group_members;


Note: Cluster boot failure does the following

# on failed node execution

SELECT @ @global. gtid_executed;

# on Master node execution

SET gtid_next= ' 4e2cb39d-6af1-11e8-a65c-000c29cdfd39:1 ';

BEGIN;

COMMIT;

SET gtid_next= ' AUTOMATIC ';

Reference Document: https://ronniethedba.wordpress.com/2017/04/22/ this-member-has-more-executed-transactions-than-those-present-in-the-group/


Build MySQL 8.0 Group Replication

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.