wget -c http://ftp.kddilabs.jp/infosystems/apache/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz
tar -zxvf zookeeper-3.4.11.tar.gz -C /home/xxxx/
mv zoo_sample.cfg zoo.cfg
修改zoo.cfg配置文件apache
dataDir=/home/xxxx/log/zookeeper
echo "1">/home/xxxx/log/zookeeper/myid
myid裏面的數字爲1表明節點1,爲2表明節點2測試
server.1=192.168.56.101:2888:3888 server.2=192.168.56.102:2888:3888 server.3=192.168.56.103:2888:3888
其中,server.x中的x是上面myid裏面的數字日誌
分別啓動三個節點code
./zkServer.sh start
./zkServer.sh status
出現Mode: follower
或者Mode: leader
即爲集羣搭建成功server
tail -f zookeeper.out