标签:lis sample tar.gz follow 文件 sof oca class ade
zookeeper-3.5.3-beta.tar.gz
cd /soft/zookeeper
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.5.3-beta/zookeeper-3.5.3-beta.tar.gz
tar -xvf zookeeper-3.5.3-beta.tar.gz
# 服务器1
cp -r zookeeper-3.5.3 zookeeper-3.5.3_1
# 服务器2
cp -r zookeeper-3.5.3 zookeeper-3.5.3_2
# 服务器3
cp -r zookeeper-3.5.3 zookeeper-3.5.3_3
cd /soft/zookeeper/zookeeper-3.5.3_1
mkdir data
mkdir logs
cd /soft/zookeeper/zookeeper-3.5.3_2
mkdir data
mkdir logs
cd /soft/zookeeper/zookeeper-3.5.3_3
mkdir data
mkdir logs
cd /soft/zookeeper/zookeeper-3.5.3_1/conf
cp zoo_sample.cfg zoo.cfg
cd /soft/zookeeper/zookeeper-3.5.3_2/conf
cp zoo_sample.cfg zoo.cfg
cd /soft/zookeeper/zookeeper-3.5.3_3/conf
cp zoo_sample.cfg zoo.cfg
ip:192.168.159.128(虚拟机ip)
cd /soft/zookeeper/zookeeper-3.5.3_1/conf
# 设置内容如下:
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/soft/zookeeper/zookeeper-3.5.3_1/data
dataLogDir=/soft/zookeeper/zookeeper-3.5.3_1/logs
clientPort=2181
server.1=192.168.159.128:2881:3881
server.2=192.168.159.128:2882:3882
server.3=192.168.159.128:2883:3883
# -----------------------------------
cd /soft/zookeeper/zookeeper-3.5.3_2/conf
vi zoo.cfg
# 设置内容如下:
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/soft/zookeeper/zookeeper-3.5.3_2/data
dataLogDir=/soft/zookeeper/zookeeper-3.5.3_2/logs
clientPort=2182
server.1=192.168.159.128:2881:3881
server.2=192.168.159.128:2882:3882
server.3=192.168.159.128:2883:3883
# -----------------------------------
cd /soft/zookeeper/zookeeper-3.5.3_3/conf
vi zoo.cfg
# 设置内容如下:
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/soft/zookeeper/zookeeper-3.5.3_3/data
dataLogDir=/soft/zookeeper/zookeeper-3.5.3_3/logs
clientPort=2183
server.1=192.168.159.128:2881:3881
server.2=192.168.159.128:2882:3882
server.3=192.168.159.128:2883:3883
vi /soft/zookeeper/zookeeper-3.5.3_1/data/myid #设置值为1
vi /soft/zookeeper/zookeeper-3.5.3_2/data/myid #设置值为2
vi /soft/zookeeper/zookeeper-3.5.3_3/data/myid #设置值为3
cd /soft/zookeeper
/soft/zookeeper/zookeeper-3.5.3_1/bin/zkServer.sh start
/soft/zookeeper/zookeeper-3.5.3_2/bin/zkServer.sh start
/soft/zookeeper/zookeeper-3.5.3_3/bin/zkServer.sh start
/soft/zookeeper/zookeeper-3.5.3_1/bin/zkServer.sh status
/soft/zookeeper/zookeeper-3.5.3_2/bin/zkServer.sh status
/soft/zookeeper/zookeeper-3.5.3_3/bin/zkServer.sh status
[root@centos7 local]# /soft/zookeeper/zookeeper-3.5.3_1/bin/zkServer.sh status
JMX enabled by default
Using config: /soft/zookeeper/zookeeper-3.5.3_1/bin/../conf/zoo.cfg
Mode: "follower"
[root@centos7 local]# /soft/zookeeper/zookeeper-3.5.3_2/bin/zkServer.sh status
JMX enabled by default
Using config: /soft/zookeeper/zookeeper-3.5.3_2/bin/../conf/zoo.cfg
Mode: "leader"
[root@centos7 local]# /soft/zookeeper/zookeeper-3.5.3_3/bin/zkServer.sh status
JMX enabled by default
Using config: /soft/zookeeper/zookeeper-3.5.3_3/bin/../conf/zoo.cfg
Mode: "follower"
标签:lis sample tar.gz follow 文件 sof oca class ade
原文地址:http://www.cnblogs.com/wlsblog/p/7337063.html