好文章http://www.codedump.info/?p=207
测试环境redhat5.5:
vmware建两台虚拟机(btw,似乎双核系统只能建俩,3个就死掉了)
192.168.229.129
192.168.229.130
还有种单机模仿多机的方式
initLimit=5
syncLimit=2
server.1=192.168.211.1:2888:3888
server.2=192.168.211.2:2888:3888
参考http://www.ibm.com/developerworks/cn/opensource/os-cn-zookeeper/
这里有例子不错
下载2011年12月15日的最新zookeeper
加压到
/opt/zookeeper-3.4.0/
配置/opt/zookeeper-3.4.0/conf/zoo.cfg
可以把那个例子考过来
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/opt/zookeeper-3.4.0/data/zookeeper
dataLogDir=/opt/zookeeper-3.4.0/data/log
# the port at which the clients will connect
clientPort=2181
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=192.168.229.129:2888:3888
server.2=192.168.229.130:2888:3888
修改/opt/zookeeper-3.4.0/bin/zkServer.sh
status)
# -q is necessary on some versions of linux where nc returns too quickly, and no stat result is output
#STAT=`echo stat | nc -q 1 localhost $(grep "^[[:space:]]*clientPort" "$ZOOCFG" | sed -e 's/.*=//') 2> /dev/null| grep Mode`
STAT=`echo stat | nc localhost $(grep "^[[:space:]]*clientPort" "$ZOOCFG" | sed -e 's/.*=//') 2> /dev/null| grep Mode`
以上这些多台机器一样
log和data都在dataDir下面
如果找不到log了用大招:
ps -ef|grep zookeeper
ls -l /proc/123123/fd
其中有一个是log
然后dataDir建立一个文件myid
在192.168.229.129上
echo 1 >/opt/zookeeper-3.4.0/data/zookeeper/myid
在192.168.229.130上
echo 2 >/opt/zookeeper-3.4.0/data/zookeeper/myid
对应zoo.cfg里面的
注意一定是数字
然后zkServer.sh start
启动
zkServer.sh status
看状态
echo ruok|nc localhost 2181
//are you ok?
echo dump|nc localhost 2181
echo stat|nc localhost 2181
echo srst|nc localhost 2181
zkServer.sh stop
其他链接
http://topic.csdn.net/u/20111117/14/388855b1-4531-4dcc-b55c-92b9f637262b.html
分享到:
相关推荐
zookeeper集群安装.doc
zookeeper集群安装文档,官方文档上这么解释zookeeper,它是一个分布式服务框架,是Apache Hadoop 的一个子项目,它主要是用来解决分布式应用中经常遇到的一些数据管理问题,如:统一命名服务、状态同步服务、集群...
ZooKeeper集群安装配置,里面有详细的操作步骤可以参考
Linux下Zookeeper集群的安装
本文档包括storm集群部署的整体过程:JDK部署,zookeeper集群部署,storm集群部署
java代码-使用java解决JEESZ-Zookeeper集群安装的源代码 ——学习参考资料:仅用于个人学习使用!
需要三台机器安装zookeeper集群:安装JDK环境、安装部署zookeeper集群、启动zookeeper集群、修改配置
CentOS环境安装配置AMQ集群以及zookeeper集群的安装配置
2)服务器2启动,它与最开始启动的服务器1进行通信,互相交换自己的选举结果,由于两者都没有历史数据,所以id值较大的服务器2胜出,但是由于没有达到超过半数以上的
ZooKeeper集群的安装、配置 ZooKeeper集群的安装、配置
NULL 博文链接:https://lucien-zzy.iteye.com/blog/2000362
zookeeper一键式安装shell脚本,无需手动搭建集群环境,脚本运行即可自动配置
zookeeper集群配置详解 详细描述在linux集群环境中搭建zookeeper的步骤
搭建zookeeper集群搭建zookeeper集群搭建zookeeper集群搭建zookeeper集群搭建zookeeper集群搭建zookeeper集群
此附件是快速搭建zookeeper集群的脚本,方便灵活,减少了自己一大堆复杂的操作,像运行服务一样执行几条start,stop等命令即可轻松完成集群搭建。
Windows搭建zookeeper集群,解压即用。zookeeper的版本是3.5.5,自用非常方便。
zookeeper集群环境安装
zookeeper linux 搭建流程,zookeeper linux 搭建流程zookeeper linux 搭建流程zookeeper linux 搭建流程。