天天看点

Could not obtain block blk_XXX_YYY from any node:java.io.IOException:No live nodes contain current block

错误:

    10/12/08 20:10:31 info hdfs.dfsclient: could not obtain block blk_xxxxxxxxxxxxxxxxxxxxxx_yyyyyyyy from any node: java.io.ioexception: no live nodes contain current block. will get new block locations from namenode and retry

原因:

    datanode 有一个同时处理文件的上限. 这个参数叫 xcievers。如果没有这一项配置,你可能会遇到奇怪的失败。你会在datanode的日志中看到xcievers exceeded,但是运行起来会报 missing blocks错误

解决方法:

    在conf/hdfs-site.xml里面的添加如下配置

    <property>

        <name>dfs.datanode.max.xcievers</name>

        <value>4096</value>

        <dedication> datanode 有一个同时处理文件的上限,至少要有4096</dedication>

    </property>