-
Create a session
The client can connect to the ZooKeeper server by creating a ZooKeeper instance. The four construction methods of Zookeeper are as follows:
new ZooKeeper(connectString, sessionTimeout, watcher)
new ZooKeeper(connectString, sessionTimeout, watcher, canBeReadOnly)
new ZooKeeper(connectString, sessionTimeout, watcher, sessionId, sessionPasswd)
new ZooKeeper(connectString, sessionTimeout, watcher, sessionId, sessionPasswd, canBeReadOnly)
-
create node