Client訪問HBase資料的過程
周海漢
2013.1.9
http://abloz.com
client訪問HBase資料前,先要到Zookeeper查詢hmaster的地址和-ROOT-表的region儲存在哪裡。
[zk: h47:2181(CONNECTED) 2] ls / [hbase, zookeeper]
[zk: h47:2181(CONNECTED) 28] ls /hbase [splitlog, unassigned, root-region-server, backup-masters, rs, draining, table, master, shutdown, hbaseid]
-ROOT-表的region資訊
[zk: h47:2181(CONNECTED) 27] get /hbase/root-region-server [email protected],60020,1355830061153 cZxid = 0x4100000013 ctime = Tue Dec 18 19:28:05 CST 2012 mZxid = 0x4100000013 mtime = Tue Dec 18 19:28:05 CST 2012 pZxid = 0x4100000013 cversion = 0 dataVersion = 0 aclVersion = 0 ephemeralOwner = 0x0 dataLength = 36 numChildren = 0
HMaster地址
[zk: h47:2181(CONNECTED) 1] get /hbase/master � [email protected],60000,1355830059469 cZxid = 0x4100000002 ctime = Tue Dec 18 19:27:39 CST 2012 mZxid = 0x4100000002 mtime = Tue Dec 18 19:27:39 CST 2012 pZxid = 0x4100000002 cversion = 0 dataVersion = 0 aclVersion = 0 ephemeralOwner = 0x13badc4e12c0000 dataLength = 39 numChildren = 0
[zk: h47:2181(CONNECTED) 35] get /hbase/table/-ROOT-
�
[zk: h47:2181(CONNECTED) 38] get /hbase/shutdown � [email protected] Dec 18 19:28:00 CST 2012 cZxid = 0x4100000008 ctime = Tue Dec 18 19:28:00 CST 2012 mZxid = 0x4100000008 mtime = Tue Dec 18 19:28:00 CST 2012 pZxid = 0x4100000008 cversion = 0 dataVersion = 0 aclVersion = 0 ephemeralOwner = 0x0 dataLength = 42 numChildren = 0 [zk: h47:2181(CONNECTED) 39] get /hbase/hbaseid � [email protected] cZxid = 0x10000000b ctime = Thu Sep 27 11:57:24 CST 2012 mZxid = 0x4100000006 mtime = Tue Dec 18 19:28:00 CST 2012 pZxid = 0x10000000b cversion = 0 dataVersion = 60 aclVersion = 0 ephemeralOwner = 0x0 dataLength = 50 numChildren = 0
如非註明轉載, 均為原創. 本站遵循知識共享CC協議,轉載請註明來源