Docker部署MySQL8 MGR

  • 时间:
  • 浏览:0
  • 来源:万人牛牛棋牌_万人牛牛棋牌官网

docker run -d -it --privileged --name=mysql-mgr-node1 mysql8.0.12 /usr/sbin/initdocker run -d -it --privileged --name=mysql-mgr-node2 mysql8.0.12 /usr/sbin/initdocker run -d -it --privileged --name=mysql-mgr-node3 mysql8.0.12 /usr/sbin/init执行成功后能不能 进去容器查看MySQL服务自动启动了,这点我不不着实有点好奇~~~有知道的亲戚亲戚一些人欢迎留言。

server_id = 3loose-group_replication_local_address= "172.17.0.9:33061"同样hosts文件记得加入映射

cat /etc/my.cnf[mysqld]

server_id = 2loose-group_replication_local_address= "172.17.0.8:33061"hosts文件记得加入映射

yum install yum-utils wget -ywget https://dev.mysql.com/get/mysql30-community-release-el7-1.noarch.rpmrpm -ivh mysql30-community-release-el7-1.noarch.rpmyum install mysql-server –y安装完成后直接退出容器,不只能启动。已经 运行如下命令生成镜像

transaction_write_set_extraction = XXHASH64

loose-group_replication_group_name = 'ce9be252-2b71-11e6-b8f4-00212844f856'

loose-group_replication_start_on_boot = off

loose-group_replication_local_address= "172.17.0.7:33061"

loose-group_replication_group_seeds= "172.17.0.7:33061,172.17.0.8:33061,172.17.0.9:33061"

loose-group_replication_bootstrap_group = off

重启mysql服务

systemctl restart mysqld查看/var/log/mysqld.log上端会有另另2个临时的密码用于登录mysql服务器

set global group_replication_single_primary_mode=FALSE;set global group_replication_enforce_update_everywhere_checks=TRUE;

docker commit 容器ID mysql8.0.12使用docker images能不能 进行查看

systemctl restart mysqld进入mysql修改密码及mgr配置,命令和mysql-mgr-node2节点一模一样

stop group_replication;set global group_replication_recovery_get_public_key=ON;start group_replication;

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

最近想试试用docker部署一套MySQL8的MGR多主,按照官方文档搞了好几天不成功,网上大每种是基于5.7安装的,没办法 参考意义价值。着实有一些是基于8版本的已经 配置文件就有对,这里就不喷了。所以这篇文章是当时人的另另2个经验总结,也希望能帮助在MySQL8.0.3版本以上(为那先 说8.0.3,上端会提到,嘿嘿)部署MGR的亲戚亲戚一些人(无论单主还是多主模式)。着实我过后 成功配置过MySQL5.7的单主和多主,已经 和8还是有一定区别的。本文宿主机系统版本是CentOS7.3,MySQL最新稳定版8.0.12为主。

前期准备工作:

运行另另2个test名称的容器

docker run -d -it --name test centos

进入容器安装MySQL

docker exec -it test bash执行如下安装命令

alter user 'root'@'localhost' identified by 'Bdqn@123';现在结速配置mgr组好友克隆

mysql -u root -p"qpzsd24a5l;E"mysql第一次只能修改密码

1)2018-09-14T06:18:04.866248Z 0 [ERROR] [MY-011526] [Repl] Plugin group_replication reported: 'This member has more executed transactions than those present in the group. Local transactions: fc283fd2-b7e0-11e8-bde9-0242ac1309:1 > Group transactions: ce9be252-2b71-11e6-b8f4-00212844f856:1-2'

2018-09-14T06:18:04.866384Z 0 [ERROR] [MY-011522] [Repl] Plugin group_replication reported: 'The member contains transactions not present in the group. The member will now exit the group.'

所有节点重启MySQL服务,已经 执行

reset master;配置第另另2个引导组的MySQL节点后,加带入第六个MySQL节点到组好友克隆。

systemctl restart mysqld进入mysql修改密码及mgr配置

server_id = 1

gtid_mode = ON

enforce_gtid_consistency = ON

binlog_checksum = NONE