HMaster无法启动(报错: Cannot recoverLease)

一、报错:

关键字:

Cannot recoverLease

Failed to recover lease

master.HMaster: Failed to become active master

Cannot obtain block length for LocatedBlock

报错堆栈:

2019-10-31 18:34:48,318 INFO [cloud1:16000.activeMasterManager] balancer.StochasticLoadBalancer: loading config

2019-10-31 18:34:48,389 INFO  [cloud1:16000.activeMasterManager] master.HMaster: Server active/primary master=cloud1,16000,1572518079864, sessionid=0x26e215f68470001, setting cluster-up flag (Was=false)

2019-10-31 18:34:48,392 INFO  [master/cloud1/172.18.49.221:16000] regionserver.HRegionServer: ClusterId : 6f9b6fa5-d0aa-426e-bd0c-e7b12d437a2d

2019-10-31 18:34:48,438 INFO  [cloud1:16000.activeMasterManager] procedure.ZKProcedureUtil: Clearing all procedure znodes: /hbase/flush-table-proc/acquired /hbase/flush-table-proc/reached /hbase/flush-table-proc/abort

2019-10-31 18:34:48,484 INFO  [cloud1:16000.activeMasterManager] procedure.ZKProcedureUtil: Clearing all procedure znodes: /hbase/online-snapshot/acquired /hbase/online-snapshot/reached /hbase/online-snapshot/abort

2019-10-31 18:34:48,533 INFO  [cloud1:16000.activeMasterManager] master.MasterCoprocessorHost: System coprocessor loading is enabled

2019-10-31 18:34:48,555 INFO  [cloud1:16000.activeMasterManager] procedure2.ProcedureExecutor: Starting procedure executor threads=13

2019-10-31 18:34:48,556 INFO  [cloud1:16000.activeMasterManager] wal.WALProcedureStore: Starting WAL Procedure Store lease recovery

2019-10-31 18:34:48,559 INFO  [cloud1:16000.activeMasterManager] util.FSHDFSUtils: Recover lease on dfs file hdfs://mycluster/hbase/MasterProcWALs/state-00000000000000000001.log

2019-10-31 18:34:48,588 INFO  [cloud1:16000.activeMasterManager] util.FSHDFSUtils: Failed to recover lease, attempt=0 on file=hdfs://mycluster/hbase/MasterProcWALs/state-00000000000000000001.log after 29ms

2019-10-31 18:34:52,608 INFO  [cloud1:16000.activeMasterManager] util.FSHDFSUtils: Failed to recover lease, attempt=1 on file=hdfs://mycluster/hbase/MasterProcWALs/state-00000000000000000001.log after 4049ms

2019-10-31 18:35:56,728 INFO  [cloud1:16000.activeMasterManager] util.FSHDFSUtils: Failed to recover lease, attempt=2 on file=hdfs://mycluster/hbase/MasterProcWALs/state-00000000000000000001.log after 68169ms

2019-10-31 18:38:05,209 INFO  [cloud1:16000.activeMasterManager] util.FSHDFSUtils: Failed to recover lease, attempt=3 on file=hdfs://mycluster/hbase/MasterProcWALs/state-00000000000000000001.log after 196650ms

2019-10-31 18:41:17,427 INFO  [cloud1:16000.activeMasterManager] util.FSHDFSUtils: Failed to recover lease, attempt=4 on file=hdfs://mycluster/hbase/MasterProcWALs/state-00000000000000000001.log after 388868ms

2019-10-31 18:45:33,913 INFO  [cloud1:16000.activeMasterManager] util.FSHDFSUtils: Failed to recover lease, attempt=5 on file=hdfs://mycluster/hbase/MasterProcWALs/state-00000000000000000001.log after 645354ms

2019-10-31 18:49:46,673 ERROR [ActiveMasterInitializationMonitor-1572518086672] master.HMaster: Master failed to complete initialization after 900000ms. Please consider submitting a bug report including a thread dump of this process.

2019-10-31 18:50:54,185 INFO  [cloud1:16000.activeMasterManager] util.FSHDFSUtils: Failed to recover lease, attempt=6 on file=hdfs://mycluster/hbase/MasterProcWALs/state-00000000000000000001.log after 965626ms

2019-10-31 18:50:54,185 WARN  [cloud1:16000.activeMasterManager] util.FSHDFSUtils: Cannot recoverLease after trying for 900000ms (hbase.lease.recovery.timeout); continuing, but may be DATALOSS!!!; attempt=6 on file=hdfs://mycluster/hbase/MasterProcWALs/state-00000000000000000001.log after 965626ms

2019-10-31 18:50:54,450 ERROR [cloud1:16000.activeMasterManager] wal.WALProcedureStore: Unable to read state log: FileStatus{path=hdfs://mycluster/hbase/MasterProcWALs/state-00000000000000000001.log; isDirectory=false; length=132; replication=3; blocksize=67108864; modification_time=1572514780827; access_time=1572514780827; owner=cloud; group=supergroup; permission=rw-r--r--; isSymlink=false}

java.io.IOException: Cannot obtain block length for LocatedBlock{BP-2130371621-192.168.120.226-1506852297811:blk_1075210355_1469774; getBlockSize()=132; corrupt=false; offset=0; locs=[172.18.49.224:50010, 172.18.49.222:50010, 172.18.49.223:50010]}

        at org.apache.hadoop.hdfs.DFSInputStream.readBlockLength(DFSInputStream.java:354)

        at org.apache.hadoop.hdfs.DFSInputStream.fetchLocatedBlocksAndGetLastBlockLength(DFSInputStream.java:298)

        at org.apache.hadoop.hdfs.DFSInputStream.openInfo(DFSInputStream.java:235)

        at org.apache.hadoop.hdfs.DFSInputStream.<init>(DFSInputStream.java:228)

        at org.apache.hadoop.hdfs.DFSClient.open(DFSClient.java:1318)

        at org.apache.hadoop.hdfs.DistributedFileSystem$3.doCall(DistributedFileSystem.java:293)

        at org.apache.hadoop.hdfs.DistributedFileSystem$3.doCall(DistributedFileSystem.java:289)

        at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)

        at org.apache.hadoop.hdfs.DistributedFileSystem.open(DistributedFileSystem.java:289)

        at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:764)

        at org.apache.hadoop.hbase.procedure2.store.wal.ProcedureWALFile.open(ProcedureWALFile.java:67)

        at org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.initOldLog(WALProcedureStore.java:961)

        at org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.initOldLogs(WALProcedureStore.java:924)

        at org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.recoverLease(WALProcedureStore.java:262)

        at org.apache.hadoop.hbase.procedure2.ProcedureExecutor.start(ProcedureExecutor.java:511)

        at org.apache.hadoop.hbase.master.HMaster.startProcedureExecutor(HMaster.java:1224)

        at org.apache.hadoop.hbase.master.HMaster.startServiceThreads(HMaster.java:1136)

        at org.apache.hadoop.hbase.master.HMaster.finishActiveMasterInitialization(HMaster.java:725)

        at org.apache.hadoop.hbase.master.HMaster.access$600(HMaster.java:189)

        at org.apache.hadoop.hbase.master.HMaster$2.run(HMaster.java:1803)

        at java.lang.Thread.run(Thread.java:745)

2019-10-31 18:50:54,452 FATAL [cloud1:16000.activeMasterManager] master.HMaster: Failed to become active master

java.io.IOException: Unable to read state log: FileStatus{path=hdfs://mycluster/hbase/MasterProcWALs/state-00000000000000000001.log; isDirectory=false; length=132; replication=3; blocksize=67108864; modification_time=1572514780827; access_time=1572514780827; owner=cloud; group=supergroup; permission=rw-r--r--; isSymlink=false}

        at org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.initOldLog(WALProcedureStore.java:969)

        at org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.initOldLogs(WALProcedureStore.java:924)

        at org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.recoverLease(WALProcedureStore.java:262)

        at org.apache.hadoop.hbase.procedure2.ProcedureExecutor.start(ProcedureExecutor.java:511)

        at org.apache.hadoop.hbase.master.HMaster.startProcedureExecutor(HMaster.java:1224)

        at org.apache.hadoop.hbase.master.HMaster.startServiceThreads(HMaster.java:1136)

        at org.apache.hadoop.hbase.master.HMaster.finishActiveMasterInitialization(HMaster.java:725)

        at org.apache.hadoop.hbase.master.HMaster.access$600(HMaster.java:189)

        at org.apache.hadoop.hbase.master.HMaster$2.run(HMaster.java:1803)

        at java.lang.Thread.run(Thread.java:745)

Caused by: java.io.IOException: Cannot obtain block length for LocatedBlock{BP-2130371621-192.168.120.226-1506852297811:blk_1075210355_1469774; getBlockSize()=132; corrupt=false; offset=0; locs=[172.18.49.224:50010, 172.18.49.222:50010, 172.18.49.223:50010]}

        at org.apache.hadoop.hdfs.DFSInputStream.readBlockLength(DFSInputStream.java:354)

        at org.apache.hadoop.hdfs.DFSInputStream.fetchLocatedBlocksAndGetLastBlockLength(DFSInputStream.java:298)

        at org.apache.hadoop.hdfs.DFSInputStream.openInfo(DFSInputStream.java:235)

        at org.apache.hadoop.hdfs.DFSInputStream.<init>(DFSInputStream.java:228)

        at org.apache.hadoop.hdfs.DFSClient.open(DFSClient.java:1318)

        at org.apache.hadoop.hdfs.DistributedFileSystem$3.doCall(DistributedFileSystem.java:293)

        at org.apache.hadoop.hdfs.DistributedFileSystem$3.doCall(DistributedFileSystem.java:289)

        at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)

        at org.apache.hadoop.hdfs.DistributedFileSystem.open(DistributedFileSystem.java:289)

        at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:764)

        at org.apache.hadoop.hbase.procedure2.store.wal.ProcedureWALFile.open(ProcedureWALFile.java:67)

        at org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.initOldLog(WALProcedureStore.java:961)


二、原因:

1、可能是由于集群服务器断电导致(我的情况就是这样,前一天服务器全部断电。)

2、其他未知原因。


三、解决办法:

解决办法是需要删掉hdfs上的/hbase/MasterProcWALs和/hbase/WALs目录下的所有文件(如果担心出问题,可以先备份这两个文件夹,hdfs dfs -cp /hbase/WALs /hbase/WALs.bak),当然我也删了zk中/hbase,然后启动hbase即可。


四、参考文章:

1、apache zookeeper - HBase Master won't start - Stack Overflow

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 205,386评论 6 479
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 87,939评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,851评论 0 341
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,953评论 1 278
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,971评论 5 369
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,784评论 1 283
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,126评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,765评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 43,148评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,744评论 2 323
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,858评论 1 333
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,479评论 4 322
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,080评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,053评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,278评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,245评论 2 352
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,590评论 2 343