1. Create nodes, sub nodes, etc...
2. Get / Set data for a node
3. Watch a node
4. Delete a node
# start zookeeper
sudo service zookeeper start
# verify it's started
nc -vz localhost 2181
bin/zookeeper-shell.sh localhost 2181
# display help
help
# display root
ls /
create /my-node "foo"
ls /
get /my-node
set /my-node "new data"
create /my-node/deeper-node "bar"
ls /
ls /my-node
ls /my-node/deeper-node
get /my-node/deeper-node
rmr /my-node/deeper-node
rmr /my-node
ls /
# create a watcher
create /node-to-watch ""
get /node-to-watch true
set /node-to-watch "new data"
set /node-to-watch "whatever"
댓글 없음:
댓글 쓰기