Archive for the ‘znodes’ Tag

ZooKeeper: znodes

You can view details of your ZooKeeper instance using zk_dump from the hbase shell.

 

hbase(main):001:0> zk_dump
HBase is rooted at /hbase
Active master address: hbase2,52114,1352384965804
Backup master addresses:
Region server holding ROOT: hbase2,43876,1352384966172
Region servers:
 hbase2,43876,1352384966172
Quorum Server Statistics:
 localhost:2181
  Zookeeper version: 3.4.3-cdh4.1.0--1, built on 09/29/2012 17:54 GMT
  Clients:
   /127.0.0.1:43352[1](queued=0,recved=12,sent=12)
   /127.0.0.1:43146[1](queued=0,recved=2459,sent=2466)
   /127.0.0.1:43147[1](queued=0,recved=2283,sent=2284)
   /127.0.0.1:43354[0](queued=0,recved=1,sent=0)
   /127.0.0.1:43145[1](queued=0,recved=2551,sent=2645)

  Latency min/avg/max: 0/0/104
  Received: 7519
  Sent: 7620
  Outstanding: 0
  Zxid: 0xa9
  Mode: standalone
  Node count: 16

hbase(main):002:0>

HBase creates a list of znodes under its root node that contain various details. Let us examine the values they hold using the zookeeper-client tool.

 

abhi@hbase2:~$ zookeeper-client 
Connecting to localhost:2181
2012-11-08 13:56:27,437 [myid:] - INFO  [main:Environment@100] - Client environment:zookeeper.version=3.4.3-cdh4.1.0--1, built on 09/29/2012 17:54 GMT
2012-11-08 13:56:27,441 [myid:] - INFO  [main:Environment@100] - Client environment:host.name=hbase2
2012-11-08 13:56:27,441 [myid:] - INFO  [main:Environment@100] - Client environment:java.version=1.6.0_31
2012-11-08 13:56:27,442 [myid:] - INFO  [main:Environment@100] - Client environment:java.vendor=Sun Microsystems Inc.
2012-11-08 13:56:27,443 [myid:] - INFO  [main:Environment@100] - Client environment:java.home=/opt/java/jdk1.6.0_31/jre
2012-11-08 13:56:27,444 [myid:] - INFO  [main:Environment@100] - Client environment:java.class.path=/usr/lib/zookeeper/bin/../build/classes:/usr/lib/zookeeper/bin/../build/lib/*.jar:/usr/lib/zookeeper/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/lib/zookeeper/bin/../lib/slf4j-api-1.6.1.jar:/usr/lib/zookeeper/bin/../lib/netty-3.2.2.Final.jar:/usr/lib/zookeeper/bin/../lib/log4j-1.2.15.jar:/usr/lib/zookeeper/bin/../lib/jline-0.9.94.jar:/usr/lib/zookeeper/bin/../zookeeper-3.4.3-cdh4.1.0.jar:/usr/lib/zookeeper/bin/../src/java/lib/*.jar:/etc/zookeeper/conf::/etc/zookeeper/conf:/usr/lib/zookeeper/zookeeper.jar:/usr/lib/zookeeper/zookeeper-3.4.3-cdh4.1.0.jar:/usr/lib/zookeeper/lib/log4j-1.2.15.jar:/usr/lib/zookeeper/lib/slf4j-api-1.6.1.jar:/usr/lib/zookeeper/lib/slf4j-log4j12-1.6.1.jar:/usr/lib/zookeeper/lib/netty-3.2.2.Final.jar:/usr/lib/zookeeper/lib/jline-0.9.94.jar
2012-11-08 13:56:27,444 [myid:] - INFO  [main:Environment@100] - Client environment:java.library.path=/opt/java/jdk1.6.0_31/jre/lib/amd64/server:/opt/java/jdk1.6.0_31/jre/lib/amd64:/opt/java/jdk1.6.0_31/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2012-11-08 13:56:27,445 [myid:] - INFO  [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2012-11-08 13:56:27,446 [myid:] - INFO  [main:Environment@100] - Client environment:java.compiler=<NA>
2012-11-08 13:56:27,446 [myid:] - INFO  [main:Environment@100] - Client environment:os.name=Linux
2012-11-08 13:56:27,447 [myid:] - INFO  [main:Environment@100] - Client environment:os.arch=amd64
2012-11-08 13:56:27,447 [myid:] - INFO  [main:Environment@100] - Client environment:os.version=3.2.0-29-generic
2012-11-08 13:56:27,448 [myid:] - INFO  [main:Environment@100] - Client environment:user.name=abhi
2012-11-08 13:56:27,449 [myid:] - INFO  [main:Environment@100] - Client environment:user.home=/home/abhi
2012-11-08 13:56:27,449 [myid:] - INFO  [main:Environment@100] - Client environment:user.dir=/home/abhi
2012-11-08 13:56:27,452 [myid:] - INFO  [main:ZooKeeper@433] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@42b988a6
Welcome to ZooKeeper!
2012-11-08 13:56:27,515 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@958] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
JLine support is enabled
2012-11-08 13:56:27,534 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@850] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2012-11-08 13:56:27,576 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1187] - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x13ae06ce9780006, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] get /hbase/hbaseid
�
   1126@hbase21c3139f4-de24-4d59-9441-755a0e3f572e
cZxid = 0xc
ctime = Thu Nov 08 06:29:26 PST 2012
mZxid = 0xd
mtime = Thu Nov 08 06:29:26 PST 2012
pZxid = 0xc
cversion = 0
dataVersion = 1
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 52
numChildren = 0
[zk: localhost:2181(CONNECTED) 1] get /hbase/master
�
   1126@hbase2hbase2,52114,1352384965804
cZxid = 0x9
ctime = Thu Nov 08 06:29:26 PST 2012
mZxid = 0x9
mtime = Thu Nov 08 06:29:26 PST 2012
pZxid = 0x9
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x13ae06ce9780000
dataLength = 44
numChildren = 0
[zk: localhost:2181(CONNECTED) 2] get /hbase/replication
Node does not exist: /hbase/replication
[zk: localhost:2181(CONNECTED) 3] get /hbase/root-region-server
�
   1126@hbase2hbase2,43876,1352384966172
cZxid = 0x15
ctime = Thu Nov 08 06:29:33 PST 2012
mZxid = 0x15
mtime = Thu Nov 08 06:29:33 PST 2012
pZxid = 0x15
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 42
numChildren = 0
[zk: localhost:2181(CONNECTED) 4] ls /hbase/rs
[hbase2,43876,1352384966172]
[zk: localhost:2181(CONNECTED) 5] get /hbase/shutdown
�
   1126@hbase2Thu Nov 08 06:29:26 PST 2012
cZxid = 0xf
ctime = Thu Nov 08 06:29:26 PST 2012
mZxid = 0xf
mtime = Thu Nov 08 06:29:26 PST 2012
pZxid = 0xf
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 44
numChildren = 0
[zk: localhost:2181(CONNECTED) 6] ls /hbase/splitlog
[]
[zk: localhost:2181(CONNECTED) 7] ls /hbase/table
[]
[zk: localhost:2181(CONNECTED) 8] ls /hbase/unassigned
[]
[zk: localhost:2181(CONNECTED) 9]