自0.96版本之后窥摄,hbase 源碼結(jié)構(gòu)上做了很大的優(yōu)化套腹,目錄結(jié)構(gòu)也發(fā)生了變化另假,做了精簡(jiǎn)和優(yōu)化像屋,這里以1.2.0-cdh5.7.2為例介紹,目錄如下:
1边篮,在hdfs的路徑
[root@namenode1 ~]# hadoop fs -ls /hbase
Found 9 items
drwxr-xr-x - hbase hbase 0 2017-01-07 16:02 /hbase/.tmp --當(dāng)對(duì)表做創(chuàng)建或者刪除操作的時(shí)候己莺,會(huì)將表move 到該 .tmp 目錄下,然后再去做處理操作苟耻。
drwxr-xr-x - hbase hbase 0 2017-01-15 18:59 /hbase/MasterProcWALs
drwxr-xr-x - hbase hbase 0 2017-01-06 20:34 /hbase/WALs
drwxr-xr-x - hbase hbase 0 2017-01-10 10:47 /hbase/archive --HBase 在做 Split或者 compact 操作完成之后篇恒,會(huì)將 HFile 移到archive 目錄中,然后將之前的 hfile 刪除掉,該目錄由 HMaster 上的一個(gè)定時(shí)任務(wù)定期去清理.
drwxr-xr-x - hbase hbase 0 2016-08-17 13:50 /hbase/corrupt --存儲(chǔ)HBase做損壞的日志文件扶檐,一般都是為空的
drwxr-xr-x - hbase hbase 0 2016-12-26 15:33 /hbase/data --這個(gè)才是 hbase 的核心目錄凶杖,0.98版本里支持 namespace 的概念模型,系統(tǒng)會(huì)預(yù)置兩個(gè) namespace 即:hbase和default
-rw-r--r-- 3 hbase hbase 42 2016-08-05 17:24 /hbase/hbase.id -- 它是一個(gè)文件款筑,存儲(chǔ)集群唯一的 cluster id 號(hào)智蝠,是一個(gè) uuid
-rw-r--r-- 3 hbase hbase 7 2016-08-05 17:24 /hbase/hbase.version --同樣也是一個(gè)文件,存儲(chǔ)集群的版本號(hào)奈梳,貌似是加密的杈湾,看不到,只能通過(guò)web-ui 才能正確顯示出來(lái)
drwxr-xr-x - hbase hbase 0 2017-01-15 18:38 /hbase/oldWALs --這里對(duì)應(yīng)0.94的.oldlogs 目錄
** /hbase/data/hbase**
這個(gè)namespace 下面存儲(chǔ)了 HBase 的 namespace攘须、meta 和acl 三個(gè)表漆撞,這里的 meta 表跟0.94版本的.META.是一樣的,自0.96之后就已經(jīng)將 ROOT 表去掉了于宙,直接從Zookeeper 中找到meta 表的位置浮驳,然后通過(guò) meta 表定位到 region。 namespace 中存儲(chǔ)了 HBase 中的所有 namespace 信息捞魁,包括預(yù)置的hbase 和 default至会。acl 則是表的用戶權(quán)限控制。
如果自定義一些 namespace 的話谱俭,就會(huì)再/hbase/data 目錄下新建一個(gè) namespace 文件夾奉件,該 namespace 下的表都將 flush 到該目錄下。
//表空間的查看
[root@namenode1 ~]# hadoop fs -ls /hbase/data
Found 4 items
drwxr-xr-x - hbase hbase 0 2016-11-16 10:00 /hbase/data/bdcbasApp
drwxr-xr-x - hbase hbase 0 2017-01-07 16:02 /hbase/data/default
drwxr-xr-x - hbase hbase 0 2017-01-09 15:43 /hbase/data/eca_ns
drwxr-xr-x - hbase hbase 0 2016-08-05 17:24 /hbase/data/hbase
2昆著,每張表都維護(hù) tabledesc和regioninfo
[root@namenode1 ~]# hadoop fs -ls /hbase/data/eca_ns/ECA_SMDA_NORM
Found 3 items
drwxr-xr-x - hbase hbase 0 2017-01-09 15:43 /hbase/data/eca_ns/ECA_SMDA_NORM/.tabledesc --這里存儲(chǔ)tabledesc的信息
drwxr-xr-x - hbase hbase 0 2017-01-09 15:43 /hbase/data/eca_ns/ECA_SMDA_NORM/.tmp
drwxr-xr-x - hbase hbase 0 2017-01-09 16:44 /hbase/data/eca_ns/ECA_SMDA_NORM/f9ff9447086496a3d7adc4bff4aade79 --這里存儲(chǔ)的有regioninfo的信息
[root@namenode1 ~]# hadoop fs -ls /hbase/data/eca_ns/ECA_SMDA_NORM/.tabledesc
Found 1 items
-rw-r--r-- 3 hbase hbase 292 2017-01-09 15:43 /hbase/data/eca_ns/ECA_SMDA_NORM/.tabledesc/.tableinfo.0000000001
[root@namenode1 ~]# hadoop fs -ls /hbase/data/eca_ns/ECA_SMDA_NORM/
Found 3 items
drwxr-xr-x - hbase hbase 0 2017-01-09 15:43 /hbase/data/eca_ns/ECA_SMDA_NORM/.tabledesc
drwxr-xr-x - hbase hbase 0 2017-01-09 15:43 /hbase/data/eca_ns/ECA_SMDA_NORM/.tmp
drwxr-xr-x - hbase hbase 0 2017-01-09 16:44 /hbase/data/eca_ns/ECA_SMDA_NORM/f9ff9447086496a3d7adc4bff4aade79
[root@namenode1 ~]# hadoop fs -ls /hbase/data/eca_ns/ECA_SMDA_NORM/.tmp
[root@namenode1 ~]# hadoop fs -ls /hbase/data/eca_ns/ECA_SMDA_NORM/f9ff9447086496a3d7adc4bff4aade79
Found 4 items
-rw-r--r-- 3 hbase hbase 47 2017-01-09 15:43 /hbase/data/eca_ns/ECA_SMDA_NORM/f9ff9447086496a3d7adc4bff4aade79/.regioninfo
drwxr-xr-x - hbase hbase 0 2017-01-09 16:44 /hbase/data/eca_ns/ECA_SMDA_NORM/f9ff9447086496a3d7adc4bff4aade79/.tmp
drwxr-xr-x - hbase hbase 0 2017-01-09 16:44 /hbase/data/eca_ns/ECA_SMDA_NORM/f9ff9447086496a3d7adc4bff4aade79/info --列族
drwxr-xr-x - hbase hbase 0 2017-01-09 15:43 /hbase/data/eca_ns/ECA_SMDA_NORM/f9ff9447086496a3d7adc4bff4aade79/recovered.edits
hbase在zk的目錄結(jié)構(gòu)
[zk: localhost:2181(CONNECTED) 1] ls /hbase
[replication, meta-region-server, rs, splitWAL, backup-masters, table-lock, flush-table-proc, region-in-transition, online-snapshot, master, running, recovering-regions, draining, namespace, hbaseid, table]
hbase(main):001:0> zk_dump
HBase is rooted at /hbase
Active master address: datanode1,60000,1483706056881
Backup master addresses:
Region server holding hbase:meta: datanode3,60020,1483706055770
Region servers:
datanode2,60020,1483706054731
datanode0,60020,1483706054027
datanode4,60020,1483706055881
datanode3,60020,1483706055770
datanode7,60020,1483706055693
datanode5,60020,1483706054452
/hbase/replication:
/hbase/replication/peers:
/hbase/replication/rs:
/hbase/replication/rs/datanode5,60020,1483706054452:
/hbase/replication/rs/datanode7,60020,1483706055693:
/hbase/replication/rs/datanode3,60020,1483706055770:
/hbase/replication/rs/datanode4,60020,1483706055881:
/hbase/replication/rs/datanode0,60020,1483706054027:
/hbase/replication/rs/datanode2,60020,1483706054731:
Quorum Server Statistics:
localhost:2181
Zookeeper version: 3.4.5-cdh5.7.2--1, built on 07/22/2016 19:18 GMT
Clients:
/172.16.171.9:48487[1](queued=0,recved=5107,sent=5107)
/172.16.171.17:36252[1](queued=0,recved=50936,sent=50936)
/172.16.171.20:47011[1](queued=0,recved=19631,sent=19631)
/172.16.171.19:62253[1](queued=0,recved=7455,sent=7455)
/127.0.0.1:18625[1](queued=0,recved=22,sent=22)
/172.16.171.11:34643[1](queued=0,recved=7456,sent=7456)
/127.0.0.1:18621[1](queued=0,recved=3,sent=3)
/172.16.171.21:38192[1](queued=0,recved=7467,sent=7467)
/172.16.171.17:36254[1](queued=0,recved=50936,sent=50936)
/172.16.171.5:60302[1](queued=0,recved=7456,sent=7456)
/172.16.171.9:48540[1](queued=0,recved=25518,sent=25518)
/172.16.171.9:32467[1](queued=0,recved=7455,sent=7455)
/172.16.171.8:61522[1](queued=0,recved=10566,sent=10586)
/172.16.171.19:16777[1](queued=0,recved=25518,sent=25518)
/127.0.0.1:18626[0](queued=0,recved=1,sent=0)
/172.16.171.8:45515[1](queued=0,recved=7455,sent=7455)
/172.16.171.12:18371[1](queued=0,recved=381742,sent=381742)
Latency min/avg/max: 0/3/51663
Received: 1431771
Sent: 1461307
Connections: 17
Outstanding: 0
Zxid: 0x2600046a80
Mode: follower
Node count: 5349