标签:
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
@zookeeper
标签:
原文地址:http://www.cnblogs.com/rocky24/p/5076492.html