一、前言
最近一年了吧,总是忙于特定项目的业务分析和顶层设计,很少花时间和精力放到具体的技术细节,感觉除了架构理念和分析能力的提升,在具体技术层次却并没有多大的进步。因为一些原因,总被人问及一些技术细节,很多细节都模糊了,花点时间,温习一下吧。技术部分将作为下一个阶段的工作重点。
二、操作说明
查看Zookeeper内部HBase相关数据,有两个主要的渠道:一、通过Hbase shell命令zk_dump查看;二、通过zk_cli.sh查看;
三、zk_dump
1 HBase is rooted at /hbase 2 Active master address: localhost,60000,1411261739960 3 Backup master addresses: 4 Region server holding hbase:meta: localhost,60020,1411261739301 5 Region servers: 6 localhost,60020,1411261739301 7 /hbase/replication: 8 /hbase/replication/peers: 9 /hbase/replication/rs: 10 /hbase/replication/rs/localhost,60020,1411261739301: 11 Quorum Server Statistics: 12 192.168.230.128:2181 13 Zookeeper version: 3.4.6-1569965, built on 02/20/2014 09:09 GMT 14 Clients: 15 /192.168.230.128:54264[1](queued=0,recved=204,sent=212) 16 /192.168.230.128:54269[1](queued=0,recved=113,sent=113) 17 /192.168.230.128:54265[1](queued=0,recved=460,sent=507) 18 /192.168.230.128:54271[1](queued=0,recved=131,sent=131) 19 /192.168.230.128:54274[1](queued=0,recved=86,sent=86) 20 /192.168.230.128:54656[1](queued=0,recved=12,sent=12) 21 /192.168.230.128:54654[1](queued=0,recved=3,sent=3) 22 /192.168.230.128:54270[1](queued=0,recved=94,sent=94) 23 /192.168.230.128:54481[1](queued=0,recved=242,sent=242) 24 /192.168.230.128:54657[0](queued=0,recved=1,sent=0) 25 26 Latency min/avg/max: 0/1/155 27 Received: 1352 28 Sent: 1406 29 Connections: 10 30 Outstanding: 0 31 Zxid: 0x65 32 Mode: standalone 33 Node count: 38
四、zk_cli.sh
1 [zk: 192.168.230.128:2181(CONNECTED) 30] ls 2 ZooKeeper -server host:port cmd args 3 connect host:port 4 get path [watch] 5 ls path [watch] 6 set path data [version] 7 rmr path 8 delquota [-n|-b] path 9 quit 10 printwatches on|off 11 create [-s] [-e] path data acl 12 stat path [watch] 13 close 14 ls2 path [watch] 15 history 16 listquota path 17 setAcl path acl 18 getAcl path 19 sync path 20 redo cmdno 21 addauth scheme auth 22 delete path [version] 23 setquota -n|-b val path 24 [zk: 192.168.230.128:2181(CONNECTED) 31] ls / 25 [hbase, zookeeper] 26 [zk: 192.168.230.128:2181(CONNECTED) 32] ls /hbase 27 [meta-region-server, backup-masters, table, draining, region-in-transition, table-lock, running, master, namespace, hbaseid, online-snapshot, replication, splitWAL, recovering-regions, rs] 28 [zk: 192.168.230.128:2181(CONNECTED) 33]
五、说明
关于输出结果的解读,就不去细说了,感兴趣的兄弟,自己去问度娘吧。
莫愁前路无知己,夜漫自有早行人。大数据架构师技术交流:
347018601
作者:张子良
出处:http://www.cnblogs.com/hadoopdev
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。