-
上传zookeeper安装包到集群中的任意一台机器上
-
解压tar -zxvf zookeeper-3.4.5.tar.gz
-
切换到zookeeper下的conf目录
cd /home/hduser/zookeeper/zookeeper-3.5.6/conf
-
编辑zoo.cfg文件
mv zoo_sample.cfg zoo.cfg vi zoo.cfg dataDir=/home/hduser/zookeeper/zookeeper-3.5.6/data #修改数据存放的目录 server.1=slave01:2888:3888 server.2=slave02:2888:3888 server.3=slave03:2888:3888
-
创建数据存放目录,并创建myid文件
mkdir /home/hduser/zookeeper/zookeeper-3.5.6/data cd /home/hduser/zookeeper/zookeeper-3.5.6/data echo 1 > myid
-
把zookeeper安装文件夹发送到集群的其他机器
scp -r /home/hduser/zookeeper/ hdsuer@salve02:/home/hduser/zookeeper scp -r /home/hduser/zookeeper/ hdsuer@slave03:/home/hduser/zookeeper
-
修改其他机器上的myid
…… echo 2 > myid echo 3 > myid
-
分别启动zookeeper
cd /home/hduser/zookeeper/zookeeper-3.5.6/bin ./zkServer.sh start
-
查看进程 jps
image.png -
查看zookeeper状态
image.png./zkServer.sh status
网友评论