Zookeeper集群搭建
zookeeper安装
192.168.19.210(myid=210) 192.168.19.211(myid=211) 192.168.19.212(myid=212)
下载zookeeper
cd /tmp wget -N http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz tar -zxf zookeeper-3.4.5.tar.gz mv ./zookeeper-3.4.5 /opt/zookeeper mkdir /opt/zookeeper/data mkdir /opt/zookeeper/logs echo 'tickTime=2000' > /opt/zookeeper/conf/zoo.cfg echo 'initLimit=10' >> /opt/zookeeper/conf/zoo.cfg echo 'syncLimit=5' >> /opt/zookeeper/conf/zoo.cfg echo 'dataDir=/opt/zookeeper/data' >> /opt/zookeeper/conf/zoo.cfg echo 'dataLogDir=/opt/zookeeper/logs' >> /opt/zookeeper/conf/zoo.cfg echo 'clientPort=2181' >> /opt/zookeeper/conf/zoo.cfg #server.myid=192.168.19.XXX:2888:3888 echo 'server.210=192.168.19.210:2888:3888' >> /opt/zookeeper/conf/zoo.cfg echo 'server.211=192.168.19.211:2888:3888' >> /opt/zookeeper/conf/zoo.cfg echo 'server.212=192.168.19.212:2888:3888' >> /opt/zookeeper/conf/zoo.cfg #192.168.19.210 echo '210' > /opt/zookeeper/data/myid #192.168.19.211 echo '211' > /opt/zookeeper/data/myid #192.168.19.212 echo '212' > /opt/zookeeper/data/myid
开机启动
echo '/opt/zookeeper/bin/zkServer.sh start' >> /etc/rc.d/rc.local
环境变量
echo 'export PATH=$PATH:/opt/zookeeper/bin' >> /etc/profile source /etc/profile
ZooKeeper服务命令
/opt/zookeeper/bin/zkServer.sh start /opt/zookeeper/bin/zkServer.sh status /opt/zookeeper/bin/zkServer.sh stop /opt/zookeeper/bin/zkServer.sh restart
本文由用户 ymc4 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!