@zookeeper

1 下载 ZK
wget  http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.7/zookeeper-3.4.7.tar.gz

2 解压
tar -zxvf zookeeper-3.4.7.tar.gz

3 修改配置文件 
cp zoo_sample.cfg zoo.cfg  

mv zookeeper-3.4.6/conf/zoo_sample.cfg zookeeper-3.4.6/conf/zoo.cfg

vi zoo.cfg
tickTime=2000
dataDir=/usr/local/opt/zookeeper/data
clientPort=2181
initLimit=10
syncLimit=5
server.1=s1:2888:3888
server.2=s2:2888:3888
server.3=s3:2888:3888
4 创建 myid
在 zoo.cfg 中的 dataDir  文件夹中创建 myid
mkdir -p /home/hadoop/zookeeper/data

三台机分别
echo "1"> /home/hadoop/zookeeper/data/myid
echo "2"> /home/hadoop/zookeeper/data/myid
echo "3"> /home/hadoop/zookeeper/data/myid

5 三机启动
./zookeeper-3.4.6/bin/zkServer.sh start
./bin/zkServer.sh start

6 验证
./zookeeper-3.4.6/
./bin/zkServer.sh status
进入 ./zookeeper-3.4.6/bin/zkCli.sh -server s1:2181










posted @ 2015-12-25 17:23  rocky_24  阅读(175)  评论(0编辑  收藏  举报
希望祖国繁荣,富强! God has given me a gift. Only one. I am the most complete fighter in the world. My whole life, I have trained. I must prove I am worthy of someting. rocky_24