zkClient.createEphemeral(“/path/xxx”) 临时
zkClient.createPersistent(“/path/xxx”) 持久到硬盘
zkClient.subscribeDataChanges(“/db”, new IZkDataListener() {
public void handleDataChange(String dataPath, byte[] data) throws Exception {
System.out.println(new String(data));
}
public void handleDataDeleted(String dataPath) throws Exception {
System.out.println(dataPath);
}
});