Linux下Zookeeper的安裝
阿新 • • 發佈:2019-01-03
1.解壓,建立日誌目錄
[[email protected] software]# tar -zxvf zookeeper-3.4.8.tar.gz -C /usr/local/
[[email protected] software]# mkdir -p /var/data/zookeeper
[[email protected] software]# mkdir -p /var/local/server/zookeeper/log
[[email protected] local]# cd /usr/local/zookeeper-3.4.8/conf/
[[email protected] conf]# cp zoo_sample.cfg zoo.cfg
2.編輯檔案zoo.cfg
[[email protected] conf]# vim zoo.cfg
tickTime=2000
dataDir=/var/data/zookeeper
dataLogDir=/var/local/server/zookeeper/log
clientPort=2181
initLimit=5
syncLimit=2
server.1=c1:2888:3888
#server.2=c2:2888:3888
#server.3=c3:2888:3888
3.建立myid檔案,並修改hosts檔案
[ [email protected] src]# cd /var/data/
[[email protected] data]# touch myid
[[email protected] data]# echo 1 > /var/data/zookeeper/myid
[[email protected] data]# vim /etc/hosts/
192.168.1.100 c1
4.啟動zookeeper
[[email protected] bin]# cd /usr/local/zookeeper-3.4.8/bin/
[[email protected] bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.8/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED