Installing Apache ZooKeeper
zookeeper-3.4.6.tar.gz from Apache ZooKeeper Download Page, to install ZooKeeper just unzip the tar file:
$ tar xvf zookeeper-3.4.6.tar.gz
ZooKeeper Getting Started Guide is a good for get you started with ZooKeeper.
Connecting To ZooKeeper
org.apache.zookeeper.tutorials.ZooKeeperConnector demonstrate how java application connect to ZooKeeper.
org.apache.zookeeper.tutorials.TestZkConnection test ZooKeeper Connection, run it as java application will output all znode name, for example in my environment, the output like:
org.apache.zookeeper.tutorials.CreateZNode show how to create znode, run it as java application will create znode
/sampleznode with data
sample znode data.
org.apache.zookeeper.tutorials.UpdateZNode show how to update znode, run it as java application will update znode
Reading ZNode Data
org.apache.zookeeper.tutorials.ReadZNode show how to read znode data, run it as java application will output the data under znode
org.apache.zookeeper.tutorials.DeleteZNode show how to delete a exist znode, run it as java application will delete znode