2012-06-13 92 views
7

我有點卡住修復故障表(在HBase的0.92.1-cdh4.0.0,Hadoop的2.0.0-cdh4.0.0)維修HBase的表(在過渡分配區域)

有一個區域轉型不完成:

Region State 
bf2025f4bc154914b5942af4e72ea063 counter_traces,1329773878.35_766a0b4df75e4381a686fbc07db9e333,1339425291230.bf2025f4bc154914b5942af4e72ea063. state=OFFLINE, ts=Tue Jun 12 11:43:53 CEST 2012 (0s ago), server=null 

當我運行sudo -u hbase hbase hbck -repair,我得到這個:

Number of empty REGIONINFO_QUALIFIER rows in .META.: 0 
ERROR: Region { meta => counter_traces,1329773878.35_766a0b4df75e4381a686fbc07db9e333,1339425291230.bf2025f4bc154914b5942af4e72ea063., hdfs => hdfs://hbase001:8020/hbase/counter_traces/bf2025f4bc154914b5942af4e72ea063, deployed => } not deployed on any region server. 
Trying to fix unassigned region... 
12/06/12 11:44:40 INFO util.HBaseFsckRepair: Region still in transition, waiting for it to become assigned: {NAME => 'counter_traces,1329773878.35_766a0b4df75e4381a686fbc07db9e333,1339425291230.bf2025f4bc154914b5942af4e72ea063.', STARTKEY => '1329773878.35_766a0b4df75e4381a686fbc07db9e333', ENDKEY => '1329793347.58_163865765c0a11e184ab003048f0e77e', ENCODED => bf2025f4bc154914b5942af4e72ea063,} 

,它只是循環。

如果我不這樣做的-repair,我得到這個:

Number of empty REGIONINFO_QUALIFIER rows in .META.: 0 
ERROR: Region { meta => counter_traces,1329773878.35_766a0b4df75e4381a686fbc07db9e333,1339425291230.bf2025f4bc154914b5942af4e72ea063., hdfs => hdfs://hbase001:8020/hbase/counter_traces/bf2025f4bc154914b5942af4e72ea063, deployed => } not deployed on any region server. 
ERROR: Region { meta => counter_traces,1329816776.95_95b5561f3c1e496598421359a19ac665,1339425297099.ee1fd808d954c9adc9ed95ec2f29d119., hdfs => hdfs://hbase001:8020/hbase/counter_traces/ee1fd808d954c9adc9ed95ec2f29d119, deployed => } not deployed on any region server. 
12/06/12 11:45:59 DEBUG util.HBaseFsck: There are 134 region info entries 
ERROR: There is a hole in the region chain between 1329773878.35_766a0b4df75e4381a686fbc07db9e333 and 1329793347.58_163865765c0a11e184ab003048f0e77e. You need to create a new .regioninfo and region dir in hdfs to plug the hole. 
ERROR: There is a hole in the region chain between 1329816776.95_95b5561f3c1e496598421359a19ac665 and 1329847231.75_b3c50776778b43e088dd7ed865e11331. You need to create a new .regioninfo and region dir in hdfs to plug the hole. 
ERROR: Found inconsistency in table counter_traces 

我幾次,之前運行-repair,它幫助。但這一次, 不再。

好的,所以這表明要做一個人工干預來解決這個問題。有人可以指導我如何做到這一點的正確方向嗎?一個食譜,網頁,例如, 任何事情都會有所幫助。

感謝, 馬里奧

回答

12

馬里奧,

那麼爲什麼一個區域卡住轉型的原因之一是因爲,當它被跨越regionservers移動,這是從源頭上RegionServer的未分配,但從未分配給其他區域服務器。 一個補丁修復總是對我的作品是由從HBase的外殼強行分配給它: -

assign regionName 
+0

這讓我朝着正確的方向前進。直接抨擊行不通,但至少我現在發現了一些代碼,幫助我填補了區域鏈中的空白。 – Mario

+0

你可以分享代碼嗎?我有類似的問題,並希望解決這個問題。 –

+0

對不起,應該當時發佈。我不認爲我已經有了。 – Mario

0

如果您的HBase的版本足夠,你也可以嘗試hbck -repairHoles,而不是僅僅-Repair。這對我最近的一個「修補漏洞」問題有訣竅。

1

首先,您應該檢查您的hdfs中是否存在該特定區域的文件。

如果有,你應該堅持使用hbck -fixHdfsHoles -fixMeta直到修復。 (可能需要嘗試幾次)。

如果在轉換中沒有這樣的文件(它應該在/ hbase/data ///下),那麼HBase認爲該目錄中該區域應該有一個有效的HFile,並且將不能用正常的修復命令修復它。

你應該做的是在這裏的最新迴應中的一個,併爲您的HDFS有效HFILE:

http://comments.gmane.org/gmane.comp.java.hadoop.hbase.user/31308

0

我試圖做區域的有力分配,但沒有奏效爲了我。我試過以下,它的工作:

步驟:

    從HBase的外殼
  • 禁用表
  • 運行hbck使用修復problmes以下命令

    sudo -u hbase hbase hbck -repair

  • 從HBase的啓用表外殼

0

對我而言,我忘了更改從另一個羣集複製的區域數據的所有者。

然後我嘗試做hbase hbck -repair但得到INFO util.HBaseFsckRepair: Region still in transition, waiting for it to become assigned 然後錯誤出現Unable to complete check or repair the region, failed to move out of transition within timeout 120000ms

我發現hbase:meta已經有區域信息。

雖然掃描表,你會得到錯誤這樣

ERROR: No server address listed in hbase:meta for region X 

然後嘗試hbase hbck -fixAssignments,但仍然未能像以前一樣。

然後我檢查表區域數據,發現只有這個表自身和羣體是

drwxr-xr-x - hdfs hbase 

但其他像這樣

drwxr-xr-x - hbase hbase

所以出現問題後改變自己和組作爲得到解決其他。 現在您將成功掃描表。