Zookeeper报KeeperErrorCode = MarshallingError 错误的说明

今天在用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);

你可能感兴趣的:(Java)