This commit is contained in:
2021-11-14 15:52:46 +08:00
parent 915c231124
commit 1e344dc204
112 changed files with 1039 additions and 1039 deletions

View File

@@ -6,17 +6,17 @@ tags: ["mysql", "group", "replication", "组复制"]
categories: ["database"]
---
# 环境
## 环境
hostname | ip | os | mysql
---- | ---- | ---- | ----
mysql_11 | 192.168.1.11 | centos7.7 | 8.0.19
mysql_22 | 192.168.1.22 | centos7.7 | 8.0.19
mysql_33 | 192.168.1.33 | centos7.7 | 8.0.19
# 安装 mysql
## 安装 mysql
- 懒得写了 ...
# 修改 my.cnf
## 修改 my.cnf
```
# mysql_11(选择一个)
server-id = 11
@@ -78,7 +78,7 @@ mysql_33 | 192.168.1.33 | centos7.7 | 8.0.19
group-replication-exit-state-action = OFFLINE_MODE
```
# 初始化集群
## 初始化集群
- 重新启动节点 mysql_11
```bash
systemctl restart mysqld
@@ -116,7 +116,7 @@ mysql_33 | 192.168.1.33 | centos7.7 | 8.0.19
- 修改 my.cnf配置 group-replication-start-on-boot = ON
# 增加节点
## 增加节点
- 重新启动节点 mysql_22
```bash
systemctl restart mysql_22
@@ -153,6 +153,6 @@ mysql_33 | 192.168.1.33 | centos7.7 | 8.0.19
- 修改 mysql_22 和 mysql_33 的 my.cnf配置 group-replication-start-on-boot = ON
# 注意
## 注意
- 每张表都必须显式指定主键