一、Zookeeper运行模式
二、单节点部署
2.1 下载包
[root@xiangys0134-docker-01 tmp]# wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz
[root@xiangys0134-docker-01 tmp]# tar -zxvf zookeeper-3.4.14.tar.gz -C /usr/local/
[root@xiangys0134-docker-01 tmp]# cd /usr/local/zookeeper-3.4.14/conf/
[root@xiangys0134-docker-01 conf]# cp zoo_sample.cfg zoo.cfg
[root@xiangys0134-docker-01 conf]# vim zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/data/zookeeper/data
clientPort=2181
dataLogDir=/data/zookeeper/logs
[root@xiangys0134-docker-01 conf]# mkdir /data/zookeeper/data -p
[root@xiangys0134-docker-01 conf]# mkdir /data/zookeeper/logs -p
[root@xiangys0134-docker-01 conf]# chown -R zk. /data/zookeeper
2.2配置用户及环境变量
[root@xiangys0134-docker-01 conf]# useradd zk
[root@xiangys0134-docker-01 conf]# passwd zk //密码可以设置想对复杂一些
[root@xiangys0134-docker-01 conf]# chown -R zk. /usr/local/zookeeper-3.4.14/
[root@xiangys0134-docker-01 conf]# vi /etc/profile //添加如下内容
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.14
export PATH=ZOOKEEPER_HOME/bin:PATH
[root@xiangys0134-docker-01 conf]# vi /home/zk/.bashrc //zk用户环境变量
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.14
export PATH=ZOOKEEPER_HOME/bin:PATH
[root@xiangys0134-docker-01 conf]# source /etc/profile
2.3启动服务
[root@xiangys0134-docker-01 conf]# su - zk -c 'zkServer.sh start'
2.4检测应用
[zk@xiangys0134-docker-01 ~]$ ps -ef|grep zookeeper
留言