這篇文章主要講解了“Hbase的某Region長(zhǎng)期處于RIT狀態(tài)怎么解決”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“Hbase的某Region長(zhǎng)期處于RIT狀態(tài)怎么解決”吧!
Hbase web UI 發(fā)現(xiàn)某Region長(zhǎng)期處于如下狀態(tài):
app_user_isnew,02,1517807389209.3eb41df715cdd0f9a2b0ce6550b586b3. state=PENDING_OPEN, ts=Wed Mar 14 21:22:10 CST 2018 (396447s ago), server=yq-hadoop184132,60020,1520836279511
Regions in Transition,沒錯(cuò),出現(xiàn)了RIT。
執(zhí)行 hbase hbck 命令檢查:
ERROR: Region { meta => app_user_isnew,02,1517807389209.3eb41df715cdd0f9a2b0ce6550b586b3., hdfs => hdfs://yq-hadoop19:8020/hbase/data/default/app_user_isnew/3eb41df715cdd0f9a2b0ce6550b586b3, deployed => , replicaId => 0 } not deployed on any region server. 18/03/19 11:40:08 INFO util.HBaseFsck: Handling overlap merges in parallel. set hbasefsck.overlap.merge.parallel to false to run serially. ERROR: There is a hole in the region chain between 02 and 03. You need to create a new .regioninfo and region dir in hdfs to plug the hole. ERROR: Found inconsistency in table app_user_isnew
檢查結(jié)果顯示,該表存在一個(gè) 空洞 問題,我們定位到如下分區(qū):
| app_user_isnew,02,1517807389209.3eb41df715cdd0f9a2b0ce6550b586b3. | yq-hadoop184140:60020| 02 | 03 |
檢查Hbase元數(shù)據(jù),元數(shù)據(jù)是存在的,如下:
hbase(main):053:0> get'hbase:meta','app_user_isnew,02,1517807389209.3eb41df715cdd0f9a2b0ce6550b586b3.' COLUMN CELL info:regioninfo timestamp=1517807391090, value={ENCODED => 3eb41df715cdd0f9a2b0ce6550b586b3, NAME => 'app_user_isnew,02,1517807389209.3eb41df715cdd0f9a2b0ce6550b586b3.', STARTKEY => '02', ENDKEY => '03'} info:seqnumDuringOpen timestamp=1520449077356, value=\x00\x00\x00\x00\x00\x00\x00\x13 info:server timestamp=1520449077356, value=yq-hadoop184140:60020 info:serverstartcode timestamp=1520449077356, value=1520214106665 4 row(s) in 0.0070 seconds
檢查HDFS目錄文件,發(fā)現(xiàn).regioninfo文件也是存在的,如下:
$ hdfs dfs -ls /hbase/data/default/app_user_isnew/3eb41df715cdd0f9a2b0ce6550b586b3 Found 3 items -rw-r--r-- 3 hbase hbase 53 2018-02-05 13:09 /hbase/data/default/app_user_isnew/3eb41df715cdd0f9a2b0ce6550b586b3/.regioninfo drwxr-xr-x - hbase hbase 0 2018-02-05 13:09 /hbase/data/default/app_user_isnew/3eb41df715cdd0f9a2b0ce6550b586b3/f1 drwxr-xr-x - hbase hbase 0 2018-03-08 02:57 /hbase/data/default/app_user_isnew/3eb41df715cdd0f9a2b0ce6550b586b3/recovered.edits
既然元數(shù)據(jù)表和HDFS目錄中都有,那應(yīng)該是該region注冊(cè)的問題,我們執(zhí)行以下命令:
hbase hbck -fixAssignments
此命令用于修復(fù)未分配,錯(cuò)誤分配或者多次分配Region的問題。
執(zhí)行結(jié)果如下:
# hbase hbck -fixAssignments 18/03/19 14:14:19 INFO Configuration.deprecation: fs.default.name is deprecated. Instead, use fs.defaultFS HBaseFsck command line options: -fixAssignments 18/03/19 14:14:19 WARN util.HBaseFsck: Got AccessDeniedException when preCheckPermission org.apache.hadoop.hbase.security.AccessDeniedException: Permission denied: action=WRITE path=hdfs://yq-hadoop19:8020/hbase/.hbase-snapshot user=hdfs at org.apache.hadoop.hbase.util.FSUtils.checkAccess(FSUtils.java:1797) at org.apache.hadoop.hbase.util.HBaseFsck.preCheckPermission(HBaseFsck.java:1929) at org.apache.hadoop.hbase.util.HBaseFsck.exec(HBaseFsck.java:4731) at org.apache.hadoop.hbase.util.HBaseFsck$HBaseFsckTool.run(HBaseFsck.java:4559) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84) at org.apache.hadoop.hbase.util.HBaseFsck.main(HBaseFsck.java:4547) Current user hdfs does not have write perms to hdfs://yq-hadoop19:8020/hbase/.hbase-snapshot. Please rerun hbck as hdfs user hbase
錯(cuò)誤顯示我們應(yīng)該使用hbase用戶執(zhí)行該命令,使用hbase用戶執(zhí)行。
sudo -u hbase hbase hbck -fixAssignments
執(zhí)行后結(jié)果: 0 inconsistencies detected. Status: OK
感謝各位的閱讀,以上就是“Hbase的某Region長(zhǎng)期處于RIT狀態(tài)怎么解決”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對(duì)Hbase的某Region長(zhǎng)期處于RIT狀態(tài)怎么解決這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是億速云,小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。