Zookeeper设置集群

时间:2016-12-26 04:40:57

标签: configuration apache-zookeeper

您好我正在尝试在集群环境中设置Zookeeper。为此,我将zoo.cfg设为:

tickTime=2000                # REQUIRED - This will be the basis of timing 

events (milliseconds)
initLimit=5                  # REQUIRED - Amount of ticks in initialization
syncLimit=2                  # REQUIRED - Amount of ticks to determine if node is still connected
dataDir=/var/lib/zookeeper   # REQUIRED - Where to store zookeeper sync data
clientPort=2181              # REQUIRED - Port which clients connect to
server.1=0.0.0.0:2888:3888 # or "0.0.0.0:2888:3888" if server.1 is the current node
server.2=server2host:2888:3888 # or "0.0.0.0:2888:3888" if server.2 is the current node
server.3=server3host:2888:3888 # or "0.0.0.0:2888:3888" if server.N is the current node

当尝试启动前景时,当前节点即1我收到错误:

if server.1 is the current node does not have the form host:port 
or host:port:portor host:port:port:type

但我相信当前节点似乎没问题。 任何人都可以指导这里可能缺少的东西。

-V

1 个答案:

答案 0 :(得分:0)

好的,我想通了,不知怎的评论没有被视为评论,因此创业公司抛出错误,修改

tickTime=2000
initLimit=5
syncLimit=2
dataDir=/var/lib/zookeeper
clientPort=2181
server.1=0.0.0.0:2888:3888
server.2=server2host:2888:3888
server.3=server3host:2888:3888

作品! -Vaibhav