为什么根目录节点不存在,而根目录下的节点存在于zookeeper实例中?

时间:2017-10-21 16:24:07

标签: apache-zookeeper

我在独立模式下运行一个动物园管理员实例又称IA,试图升级到仲裁模式,然后我准备了另外2个带有空快照目录的动物园管理员实例(IB和IC),首先在3个实例中正确修改了zoo.cfg,分别创建了myid,首先重启独立实例IA,然后启动另一个实例。

IB和IC发生了什么,他们有数据,但根目录不存在:

IB和IC:

[zk: localhost:2181(CONNECTED) 14] ls /
Node does not exist: /
[zk: localhost:2181(CONNECTED) 15] ls /zookeeper
[quota]
[zk: localhost:2181(CONNECTED) 16]

此外,IB中存在数据丢失:

[zk: localhost:2181(CONNECTED) 16] get /demo/version

cZxid = 0x30000006c
ctime = Thu Dec 22 17:49:13 CST 2016
mZxid = 0x30000006c
mtime = Thu Dec 22 17:49:13 CST 2016
pZxid = 0x6003792a0
cversion = 12764622
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 0
numChildren = 135794
[zk: localhost:2181(CONNECTED) 17]
IA看起来像:

[zk: localhost:2181(CONNECTED) 10] get /demo/version

cZxid = 0x30000006c
ctime = Thu Dec 22 17:49:13 CST 2016
mZxid = 0x30000006c
mtime = Thu Dec 22 17:49:13 CST 2016
pZxid = 0x6003792a0
cversion = 12312921
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 0
numChildren = 587495
[zk: localhost:2181(CONNECTED) 11]

IC看起来像:

[zk: localhost:2181(CONNECTED) 10] get /demo/version

cZxid = 0x30000006c
ctime = Thu Dec 22 17:49:13 CST 2016
mZxid = 0x30000006c
mtime = Thu Dec 22 17:49:13 CST 2016
pZxid = 0x6003792a0
cversion = 12312921
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 0
numChildren = 587495
[zk: localhost:2181(CONNECTED) 11]
不过,状态还不错:

IA:

[shell@kernel /data/zookeeper/zookeeper-3.4.8/bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /data/zookeeper/zookeeper-3.4.8/bin/../conf/zoo.cfg
Mode: follower

IB:

[shell@kernel /data/zookeeper/zookeeper-3.4.8/bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /data/zookeeper/zookeeper-3.4.8/bin/../conf/zoo.cfg
Mode: follower

IC:

[shell@kernel /data/zookeeper/zookeeper-3.4.8/bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /data/zookeeper/zookeeper-3.4.8/bin/../conf/zoo.cfg
Mode: leader

如上所示,版本是

  

3.4.8

提前谢谢

1 个答案:

答案 0 :(得分:0)

我设法通过将initLimitsyncLimit分别更改为10050来解决此问题,将tickTime保留为2000,然后从独立模式迁移到仲裁模式,等一下,一切都很顺利。