一、ZooKeeper 集群部署
1、主机规划
主机名 |
IP 地址 |
myid |
10.8.3.35 |
1 |
|
10.8.3.36 |
2 |
|
10.8.3.37 |
3 |
2、拓扑结构
3、部署
(1) 下载Zookeeper
[root@localhost ~]# cd /usr/local
[root@localhost local]# wget https://www.apache.org/dyn/closer.lua/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
(2)解压软件包
[root@localhost local]# tar -zxvf apache-zookeeper-3.8.4-bin.tar.gz
(3)更改文件夹名
[root@localhost local]# mv apache-zookeeper-3.8.4-bin zookeeper
(4)查看目录内容
[root@localhost local]# cd zookeeper/
[root@localhost zookeeper]# ls
bin conf docs lib LICENSE.txt NOTICE.txt README.md README_packaging.md |
(5)编辑环境变量文件
[root@localhost ~]# cd /etc/profile.d/
[root@localhost profile.d]# vi zookeeper.sh
export ZOOKEEPER_HOME=/usr/local/zookeeper export PATH=$ZOOKEEPER_HOME/bin:$PATH |
(6)使环境变量生效
[root@localhost ~]# source /etc/profile.d/zookeeper.sh
(7)修改 ZooKeeper 配置文件
登录 agent1 节点,进入 ZooKeeper 所在目录
[root@localhost ~]# cd /usr/local/zookeeper/conf
[root@localhost conf]# cp zoo_sample.cfg zoo.cfg