hadoop decommission 时卡住

hadoop decommission 时卡住

hadoop decommission一个节点Datanode,几万个block都同步过去了,但是唯独剩下2个block一直停留在哪,导致该节点几个小时也无法下线。hadoop UI中显示在Under Replicated Blocks里面有2个块始终无法消除。

Under Replicated Blocks 2
Under Replicated Blocks In Files Under Construction 2

Namenode日志里面一直有这样的滚动:

2015-01-20 15:04:47,978 INFO org.apache.hadoop.hdfs.server.namenode.FSNamesystem: Block: blk_8859027644264991843_26141120, 
Expected Replicas: 3, live replicas: 2, corrupt replicas: 0, decommissioned replicas: 1, excess 
replicas: 0, Is Open File: true, Datanodes having this block: 10.11.12.13:50010 10.11.12.14:50010 
10.11.12.15:50010 , Current Datanode: 10.11.12.13:50010, Is current datanode decommissioning: 
true

google了好久,貌似是一个hadoop的bug,https://issues.apache.org/jira/browse/HDFS-5579
NameNode发现block的Replicas不够(期待应该有3个,实际有两个),或许是namenode认为数据不完整,执着地不让这个DataNode下架。。。

最终尝试如下方式解决,把replications设置成2:

hadoop fs -setrep -R 2 /

执行完后很快,该节点就下线了,神奇的replications。

1 Comment

  1. KEVI_

    补充一下,我们也遇到了,是因为 Corrupt Blocks 导致的,删掉丢失的块就好了

Comments are closed