mysql group replication

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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的主要内容,如果未能解决你的问题,请参考以下文章

mysql8 的 group by错误

mysql group by问题

mysql为啥group by不能显示全部数据

mysql 可以group by 两个字段吗

mysql group by 能用到索引么

mysql group by导致分页重复数据问题