mysql group replication

來源:互聯網
上載者:User

標籤:mysql group replication

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 [email 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;







第二、三節點

set global  group_replication_allow_local_disjoint_gtids_join = ON; 再啟動複製




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(32),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


本文出自 “梁小明的部落格” 部落格,請務必保留此出處http://7038006.blog.51cto.com/7028006/1893607

mysql group replication

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.