mkdir -p /opt/zookeeper
cd /opt/zookeeper
将zookeeper包上传到/opt/zookeeper目录下
tar -zxvf zookeeper包
cd /opt/zookeeper/zookeeper-3.4.10/conf/
cp zoo_sample.cfg zoo.cfg
vim zoo.cfg
# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitLimit=10# The number of ticks that can pass between # sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just # example sakes.dataDir=/home/fesh/data/zookeeper
# the port at which the clients will connectclientPort=2181#对client端提供服务
server.1=master:2888:3888
server.2=slave1:2888:3888
server.3=slave2:2888:3888
2888:选举leader使用
3888:集群内机器通讯使用(leader监听此端口)