Connect to Zookeeper Server

Steps to connect to zookeeper server through zookeeper shell. 

1. Download zookeeper from http://zookeeper.apache.org/releases.html#download

2. Unzip. Open a terminal or command-line-tool and navigate to bin folder
$ cd /home/users/zookeeper-3.4.6/bin

3. Execute $./zkCli.sh -server localhost:9983
(presuming zookeeper is started on port 9983 and host is local)

4. It connects to zookeeper shell with a message "WatchedEvent state:SyncConnected type:None path:null"

5. Type "ls /" you should see list of folders and files available in root directory. Its same as listing file in linux shell. 

6. If you'd like to navigate to sub folder, type "ls /overseer/collection-queue-work"

The above command "ls /" is to list the files. 

7. Incase if you'd like to delete or remove any file, use "rmr" command. Example, incase if you'd like to delete files under /overseer/collection-queue-work, command will be : "rmr overseer/collection-queue-work". This will delete the content in collection-queue-work

8. To confirm, use "ls /overser/collection-queue-work"  and you will see [], that means its empty now.

9. To exit, use "quit"

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk