zookeeper安装

下载地址:http://zookeeper.apache.org/releases.html#download

tar -xvf zookeeper-3.4.6.tar.gz

cd zookeeper-3.4.6/conf

mv zoo_sample.cfg zoo.cfg

vim zoo.cfg

===============================================

dataDir=/export/servers/zookeeper-3.4.6/data

dataLogDir=/export/servers/zookeeper-3.4.6/logs

server.1=192.168.147.75:2888:3888

server.2=192.168.147.76:2888:3888

server.3=192.168.147.77:2888:3888

===============================================

以上是三台机器集群

server.A=B:2888:3888

A:机器唯一ID

B:机器IP

在/export/servers/zookeeper-3.4.6/data目录下创建myid文件,设置的值是:A

启动  ./bin/zkServer.sh start

停止  ./bin/zkServer.sh stop

状态  ./bin/zkServer.sh status

客户端  ./bin/zkCli.sh

相关推荐