mysql5.7 MRG集群部署学习
文章目录
1、安装mysql
2、修改配置文件:
3、安装group_replicatin插件,启动group_replication
4、添加节点node-02 node-03:
有关复制组的相关原理介绍:http://note.youdao.com/noteshare?id=9eb41d6de1af00e41314297282a43bc1
环境:
ip hostname
192…168.8.80 node-01
192…168.8.81 node-02
192…168.8.83 node-03
1、安装mysql
[root@mysql]# yum install http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm
[root@mysql]# yum -y install Percona-Server-server-57
[root@mysql]# cat /var/log/mysqld.log |grep "root@localhost"
2018-11-02T05:41:32.373113Z 1 [Note] A temporary password is generated for root@localhost: m-3SAGso6w43
[root@mysql]# mysql -uroot -pm-3SAGso6w43
mysql> show variables like '%vali%';
mysql> set global validate_password_length=4;
mysql> alter user 'root'@'localhost' identified by 'root123';
2、修改配置文件:
my.cnf配置文件里修改参数: server-id、loose-group_replication_local_address
[mysqld]
pid-file=/var/run/mysqld/mysqld.pid
log-error=/var/log/mysqld.log
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
server-id = 101
log-bin = master-bin
log-bin-index = master-bin.index
binlog_format = row
gtid-mode = ON
enforce-gtid-consistency = ON
log-bin=mysql-bin
log-slave-updates
master_info_repository=TABLE
relay_log_info_repository=TABLE
binlog_checksum=NONE
## group replication 配置
#如果server启动时尚未加载复制插件,group_replicaton 变量使用loose-前缀将指示server继续启动。
transaction_write_set_extraction=XXHASH64 #表示server必须为每个事物收集写集合,并使用XXHASH64 哈希算法将其编码为散列。
loose_group_replication_start_on_boot=OFF
loose-group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
loose-group_replication_start_on_boot=off
loose-group_replication_local_address="192..168.8.80:33061"
loose-group_replication_group_seeds="192..168.8.80:33061,192..168.8.81:33061,192..168.8.83:33061"
loose-group_replication_bootstrap_group= off
loose-group_replication_single_primary_mode=FALSE
loose-group_replication_enforce_update_everywhere_checks= TRUE
loose-group_replication_ip_whitelist="192..168.8.80,192..168.8.81,192..168.8.83"
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
3、安装group_replicatin插件,启动group_replication
[root@mysql]# mysql -uroot -proot123
mysql> set sql_log_bin=0;
mysql> grant replication slave on *.* to 'rep'@'%' identified by 'rep123';
mysql> flush privileges;
mysql> set sql_log_bin=1;
mysql> change master to master_user=www.mcyllpt.com 'rep',master_password='rep123' for channel 'group_replication_recovery';
mysql> install plugin group_replication soname 'group_replication.so';
mysql> show plugins;
+-----------------------------+----------+--------------------+----------------------+---------+
| Name | Status | Type | Library | License |
+-----------------------------+----------+--------------------+----------------------+---------+
| group_replication | ACTIVE | GROUP REPLICATION | group_replication.so | GPL |
+-----------------------------+----------+--------------------+----------------------+---------+
mysql> set global group_replication_bootstrap_group=ON;
mysql> start group_replication;
mysql> set global group_replication_bootstrap_group=OFF;
mysql> select * from performance_schema.replication_group_members;
+---------------------------+--------------------------------------+---------------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+---------------------+-------------+--------------+
| group_replication_applier | f38e5798-de61-11e8-91e6-fa163e180951 | node-01 | 3306 | ONLINE |
+---------------------------+--------------------------------------+---------------------+-------------+--------------+
4、添加节点node-02 node-03:
安装mysql、my.cnf 同上
安装group_replicatin插件,启动group_replication
mysql> set sql_log_bin=0;
mysql> grant replication slave on www.xgll521.com *yongshiyule178.com.* to 'rep'@'%' identified by 'rep123';
mysql> flush privileges;
mysql> set sql_log_bin=1;
mysql> change master to master_user='rep',master_password='rep123' for channel 'group_replication_recovery';
mysql> set global group_replication_allow_local_disjoint_www.michenggw.com gtids_join=ON;
mysql> start group_replication;
mysql> select * from performance_www.yigouyule2.cn schema.replication_group_members;
+---------------------------+--------------------------------------+---------------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+---------------------+-------------+--------------+
| group_replication_applier | 433cc62e-dd00-11e8-a653-fa163e4f3761 | node-03 | 3306 | ONLINE |
| group_replication_applier | af4e8b5d-bc99-11e8-9ad1-fa163e230ff6 | node-02 | 3306 | ONLINE |
| group_replication_applier | f38e5798-de61-11e8-91e6-fa163e180951 | node-01 | 3306 | ONLINE |
+---------------------------+--------------------------------------+---------------------+-------------+-------------
mysql5.7 MRG集群部署学习的更多相关文章
- mysql5.7.25集群部署和方案设计(附PXC一键部署脚本)
还记得我们之前部署mysql集群有多麻烦嘛?波哥来救你们啦!~ 我已将项目上传到了我的github仓库中,大家可以点击仓库地址出现的连接登录查看相应的代码!如果觉得不错别忘了转发.点赞哦! 部署步骤: ...
- k8s 集群部署--学习
kubernetes是google开源的容器集群管理系统,提供应用部署.维护.扩展机制等功能,利用kubernetes能方便管理跨集群运行容器化的应用,简称:k8s(k与s之间有8个字母) Pod:若 ...
- Elasticsearch学习总结 (Centos7下Elasticsearch集群部署记录)
一. ElasticSearch简单介绍 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口.Elasticse ...
- rocketmq学习(二) rocketmq集群部署与图形化控制台安装
1.rocketmq图形化控制台安装 虽然rocketmq为用户提供了使用命令行管理主题.消费组以及broker配置的功能,但对于不够熟练的非运维人员来说,命令行的管理界面还是较难使用的.为此,我们可 ...
- Docker学习-Kubernetes - 集群部署
Docker学习 Docker学习-VMware Workstation 本地多台虚拟机互通,主机网络互通搭建 Docker学习-Docker搭建Consul集群 Docker学习-简单的私有Dock ...
- Quartz学习笔记:集群部署&高可用
Quartz学习笔记:集群部署&高可用 集群部署 一个Quartz集群中的每个节点是一个独立的Quartz应用,它又管理着其他的节点.这就意味着你必须对每个节点分别启动或停止.Quartz集群 ...
- Dubbo入门到精通学习笔记(二十):MyCat在MySQL主从复制的基础上实现读写分离、MyCat 集群部署(HAProxy + MyCat)、MyCat 高可用负载均衡集群Keepalived
文章目录 MyCat在MySQL主从复制的基础上实现读写分离 一.环境 二.依赖课程 三.MyCat 介绍 ( MyCat 官网:http://mycat.org.cn/ ) 四.MyCat 的安装 ...
- Cassandra1.2文档学习(7)—— 规划集群部署
数据参考:http://www.datastax.com/documentation/cassandra/1.2/webhelp/index.html#cassandra/architecture/a ...
- kafka学习总结之集群部署和zookeeper
1. 集群部署 kafka集群的瓶颈主要在网络和磁盘上:kafka依赖于zookeeper,zookeeper集群的节点采用奇数个,3个节点允许一个节点失败,5个节点允许2个节点失败. 图 1 ka ...
随机推荐
- 【TCP/IP实现磁盘资源的分享-----ISCSI(互联网最小应用程序接口)】
Iscsi server: 首先把多块磁盘合并为RAID5,便于后期iscis client访问以及服务端的管理 安装 targted服务端包,以及targtedcli创建iscsi TCP/IP共享 ...
- 吐血分享:QQ群霸屏技术教程(利润篇)
QQ群技术,不论日进几百,空隙时间多的可以尝试,日进100问题不大. QQ群技术,如何赚钱,能赚多少钱?不同行业,不同关键词,不同力度,不一样的产出. 群费 群费,这个和付费群是有区别的,群费在手机端 ...
- mac 安装requests
首先mac上已经安装了python,我的是python2x,我自己安装了python3,python3安装requests,控制台,输入,pip3 install requests 下面就已经安装完成 ...
- Hadoop(7)-HDFS客户端的API操作
1 客户端环境准备 根据自己电脑的操作系统拷贝对应的编译后的hadoop jar包到非中文路径 配置HADOOP_HOME的环境变量,并且在path中配置hadoop的bin 重启电脑 2. Hdfs ...
- c#vs连接SQL sever数据库入门操作
对于需要连接数据库的项目,可以参考的简单初级代码.实现打开数据库,读入数据功能 using System; using System.Collections.Generic; using System ...
- 实用脚本 2 -- Linux下定时执行脚本
今天学习Linux下定时执行脚本,看到一篇讲解比较好的文章,特此拿来分享. 原文链接:http://www.blogjava.net/decode360/archive/2009/09/18/2877 ...
- Returning Values from Bash Functions
转自:https://www.linuxjournal.com/content/return-values-bash-functions Bash functions, unlike function ...
- 一些可能有点用处的C#开发经验
前言: 下个月就要去进行Java开发了,以后C#碰的就少了(可惜去年买了三本C#的书,几乎还是全新的……),平时一些经验都记在OneNote里面,现在收集整理出来,因为只能利用交接工作的打酱油的时间, ...
- Python 3基础教程22-单个列表操作
本文来介绍列表的操作,先看看单个列表的操作,列表有多个方法.以下多行代码,建议你写一个方法,测试运行一个方法,不然看起来很乱. # 元组操作 x = [5,6,2,1,6,7,2,7,9] # app ...
- Spring Cloud文档地址大全
Spring Cloud:http://cloud.spring.io/spring-cloud-static/spring-cloud.html Spring Cloud Config:http:/ ...