CDH版本的zookeeper环境搭建
下载
修改配置文件
mkdir -p /export/servers/zookeeper-3.4.5-cdh5.14.0/zkdatas
cd /export/servers/zookeeper-3.4.5-cdh5.14.0/conf
cp zoo_sample.cfg zoo.cfg ->备份一个zoo_sample.cfg
vim zoo.cfg
修改
dataDir=/export/servers/zookeeper-3.4.5-cdh5.14.0/zkdatas
打开
autopurge.snapRetainCount=3
autopurge.purgeInterval=1
添加
server.1=node01:2888:3888
server.2=node02:2888:3888
server.3=node03:2888:3888
echo 1 > /export/servers/zookeeper-3.4.5-cdh5.14.0/zkdatas/myid
cd /export/servers
scp -r zookeeper-3.4.5-cdh5.14.0/ node02:$PWD
scp -r zookeeper-3.4.5-cdh5.14.0/ node03:$PWD
echo 2 > /export/servers/zookeeper-3.4.5-cdh5.14.0/zkdatas/myid
echo 3 > /export/servers/zookeeper-3.4.5-cdh5.14.0/zkdatas/myid
启动
cd /export/servers/zookeeper-3.4.5-cdh5.14.0
bin/zkServer.sh start