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

@@ -7,7 +7,7 @@ tags: ["zookeeper", "centos7"]
categories: ["storage"]
---
# 环境
## 环境
主机名 | eth0 IP | eth1 IP | 操作系统 | ZK 版本 | myid
---- | ---- | ---- | ---- | ---- | ----
@@ -18,7 +18,7 @@ zk223 | 192.168.1.223 | 192.168.16.223 | CentOS7.5 | 3.4.14 | 223
- 下载 [zookeeper-3.4.14](https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz)
- eth0 网卡用于向客户端提供服务eth1 网卡用于 zookeeper 集群内部通信
# 各节点初始配置
## 各节点初始配置
- 关闭 selinux、防火墙
- 部署 java 运行环境
@@ -44,7 +44,7 @@ zk223 | 192.168.1.223 | 192.168.16.223 | CentOS7.5 | 3.4.14 | 223
echo 223 > /var/lib/zookeeper/data/myid
```
# 部署 zookeeper
## 部署 zookeeper
- 登陆 zk221下载 zookeeper解压至 /opt/ 下
- 生成配置文件
@@ -68,7 +68,7 @@ zk223 | 192.168.1.223 | 192.168.16.223 | CentOS7.5 | 3.4.14 | 223
```
- 打包 zookeeper 目录,复制到 zk222 和 zk223 上
# 启动集群
## 启动集群
- 直接启动脚本
- 在每个节点上启动 zookeeper 服务
@@ -95,7 +95,7 @@ zk223 | 192.168.1.223 | 192.168.16.223 | CentOS7.5 | 3.4.14 | 223
systemctl start zookeeper
```
# 查看集群状态
## 查看集群状态
- 查看节点状态
```bash