Zookeeper报KeeperErrorCode = MarshallingError 错误的说明

来源:互联网 发布:4k电视盒子 知乎 编辑:程序博客网 时间:2024/06/05 04:00
今天在用zookeeper创建节点时报org.apache.zookeeper.KeeperException$MarshallingErrorException: KeeperErrorCode = MarshallingError for /xxx
创建语句如下:
String path = zooKeeper.create(dir, null, null, CreateMode.PERSISTENT);

是因为没有指定创建节点对应的ACL
改成如下即可:
String path = zooKeeper.create(dir, null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
阅读全文
0 0