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