andyyuduo 发表于 2017-4-18 11:37:39

ZOOKEEPER ACL

zookeeper ACL digest

List<ACL> acls = new ArrayList<ACL>(1);   
String authentication_type = "digest";
String authentication = "mahadev:some";
for (ACL ids_acl : Ids.CREATOR_ALL_ACL) {
acls.add(ids_acl);
}
ZooKeeper zoo = new ZooKeeper("1.1.1.1", 3000, null);
zoo.addAuthInfo(authentication_type, authentication.getBytes());
zoo.create("/some", new byte, acls, CreateMode.PERSISTENT);
页: [1]
查看完整版本: ZOOKEEPER ACL