MySQL Group replication

Source: Internet
Author: User

MySQL Group replication

http://blog.csdn.net/d6619309/article/details/53691790



Mkdir-p/data/mysql/mysql_3306/{data,logs,tmp}

Mkdir-p/data/mysql/mysql_3307/{data,logs,tmp}

Mkdir-p/data/mysql/mysql_3308/{data,logs,tmp}


Chown-r mysql.mysql/data/mysql/






./bin/mysqld--defaults-file=/data/mysql/mysql_3306/my3306.cnf--basedir=/usr/local/mysql--datadir=/data/mysql/ Mysql_3306/data--user=mysql--initialize

./bin/mysqld--DEFAULTS-FILE=/DATA/MYSQL/MYSQL_3306/MY3306.CNF &

Cat/data/mysql/mysql_3306/data/error.log |grep Password

Mysql-s/tmp/mysql3306.sock-p


SET sql_log_bin=0;

ALTER USER ' root ' @ ' localhost ' identified by ' 123456 ';

SET sql_log_bin=1;


./bin/mysqld--defaults-file=/data/mysql/mysql_3307/my3307.cnf--basedir=/usr/local/mysql--datadir=/data/mysql/ Mysql_3307/data--user=mysql--initialize

./bin/mysqld--DEFAULTS-FILE=/DATA/MYSQL/MYSQL_3307/MY3307.CNF &

Cat/data/mysql/mysql_3307/data/error.log |grep Password

Mysql-s/tmp/mysql3307.sock-p


./bin/mysqld--defaults-file=/data/mysql/mysql_3308/my3308.cnf--basedir=/usr/local/mysql--datadir=/data/mysql/ Mysql_3308/data--user=mysql--initialize

./bin/mysqld--DEFAULTS-FILE=/DATA/MYSQL/MYSQL_3308/MY3308.CNF &

Cat/data/mysql/mysql_3308/data/error.log |grep Password

Mysql-s/tmp/mysql3308.sock-p


Set sql_log_bin=0;

Create user [email protected] '% ';

Grant Replication Slave on * * to [e-mail protected] '% ' identified by ' zhishuedu ';

Set sql_log_bin=1;

Change Master to master_user= ' Rpl_user ', master_password= ' zhishuedu ' for Channel ' group_replication_recovery ';


INSTALL PLUGIN group_replication SONAME ' group_replication.so ';

Show plugins;


Set global group_replication_bootstrap_group=on;

Start group_replication;

SELECT * from Performance_schema.replication_group_members;







Second to third node

Set global group_replication_allow_local_disjoint_gtids_join = on; Start Replication again




Set global group_replication_allow_local_disjoint_gtids_join = on;

Start group_replication;




SET sql_log_bin=0;

ALTER USER ' root ' @ ' localhost ' identified by ' 123456 ';

SET sql_log_bin=1;



CREATE TABLE WUBX (ID int not null,name varchar (+), primary key (ID));

INSERT into WUBX values (1, ' 1 ');

INSERT into WUBX values (2, ' 2 ');

INSERT into WUBX values (3, ' 3 ');

INSERT into WUBX values (4, ' 4 ');




Select Variable_value from Performance_schema.global_status where variable_name= ' group_replication_primary_member ';



./bin/mysqld--defaults-file=/data/mysql/mysql_3306/my3306.cnf--basedir=/usr/local/mysql--datadir=/data/mysql/ Mysql_3306/data--user=mysql--initialize


This article is from the "Liang blog" blog, make sure to keep this source http://7038006.blog.51cto.com/7028006/1893607

MySQL 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.