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