Database Reference
In-Depth Information
This has outputted the configuration of the ZooKeeper server on hc1r1m2. While it's on server hc1r1m2, you can
check that the ZooKeeper server on hc1r1m1 is still running by using the ruok (running okay?) command:
[hadoop@hc1r1m2 ~]$ nc hc1r1m1 2181
ruok
imok
The returned value of imok (I'm OK!) tells you the contacted server is running. You can then get the connection
details for server hc1r1m1 by using the cons command:
[hadoop@hc1r1m2 ~]$ nc hc1r1m1 2181
Cons
/192.168.1.106:42731[0](queued=0,recved=1,sent=0)
The response says there is just a single connection to that server. To supplement this with some basic server
details, you use the stat command:
[hadoop@hc1r1m2 ~]$ nc hc1r1m1 2181
stat
Zookeeper version: 3.4.5-cdh4.6.0--1, built on 02/26/2014 09:19 GMT
Clients:
/192.168.1.106:42732[0](queued=0,recved=1,sent=0)
Latency min/avg/max: 0/11/93
Received: 18
Sent: 17
Connections: 1
Outstanding: 0
Zxid: 0x300000006
Mode: follower
Node count: 4
This result provides status information for the ZooKeeper server on hc1r1m1. It has listed information like the
installed version and the volume of messaging. (You can find a full list of ZooKeeper commands on the Cloudera site
at archive.cloudera.com/cdh4/4/zookeeper.)
The ZooKeeper Client
An alternative to the nc command method is to use the built-in ZooKeeper client to access your servers. You can find
it with the type command, as follows:
[hadoop@hc1r1m3 ~]$ type zookeeper-client
zookeeper-client is /usr/bin/zookeeper-client
By default, the client connects to ZooKeeper on the local server:
[hadoop@hc1r1m3 ~]$ zookeeper-client
Connecting to localhost:2181
 
Search WWH ::




Custom Search