1、解压zookeeper.tar压缩包
2、删除*.xml *.txt(这些都是源码里面的东西)
rm -rf *.xml *.txt
3、删除源码信息
rm -rf contrib dist-maven docs recipes src zookeeper-3.4.5.jar.asc zookeeper-3.4.5.jar.md5 zookeeper-3.4.5.jar.sha1
4、进入conf文件夹
cd conf
5、拷贝样本
mv zoo_sample.cfg zoo.cfg
6、修改zoo.cfg配置
修改:#数据路径
dataDir = dataDir=/usr/local/zookeeper-3.4.5/zkdata
添加:#2888 做心跳同步 #3888 zookeeper选举端口
server.1=mini1:2888:3888
server.2=mini2:2888:3888
server.3=mini3:2888:3888
7、拷贝文件到另一个系统中去
scp -r zookeeper-3.4.5 root@mini3:$PWD
8、写入集群编号,这个是之后zookeeper启动设置的投票权重
echo 1 > myid
9、出现链接服务不正常
Error contacting service. It is probably not running.
10、关闭防火墙阻挡了他们投票
servic iptables stop
11、shell脚本启动
for host in mini1 mini2 mini3
do
echo "$host is starting......"
ssh $host "/usr/local/zookeeper-3.4.5/bin/zkServer.sh start"
done
2、删除*.xml *.txt(这些都是源码里面的东西)
rm -rf *.xml *.txt
3、删除源码信息
rm -rf contrib dist-maven docs recipes src zookeeper-3.4.5.jar.asc zookeeper-3.4.5.jar.md5 zookeeper-3.4.5.jar.sha1
4、进入conf文件夹
cd conf
5、拷贝样本
mv zoo_sample.cfg zoo.cfg
6、修改zoo.cfg配置
修改:#数据路径
dataDir = dataDir=/usr/local/zookeeper-3.4.5/zkdata
添加:#2888 做心跳同步 #3888 zookeeper选举端口
server.1=mini1:2888:3888
server.2=mini2:2888:3888
server.3=mini3:2888:3888
7、拷贝文件到另一个系统中去
scp -r zookeeper-3.4.5 root@mini3:$PWD
8、写入集群编号,这个是之后zookeeper启动设置的投票权重
echo 1 > myid
9、出现链接服务不正常
Error contacting service. It is probably not running.
10、关闭防火墙阻挡了他们投票
servic iptables stop
11、shell脚本启动
for host in mini1 mini2 mini3
do
echo "$host is starting......"
ssh $host "/usr/local/zookeeper-3.4.5/bin/zkServer.sh start"
done