Failed to replace a bad datanode on the existing pipeline due to no more good datanodes being avail

报错

我在写文件追加的时候报错如下:
Failed to replace a bad datanode on the existing pipeline due to no more good datanodes being available to try.

截图如下:
在这里插入图片描述

解决

对于dfs.client.block.write.replace-datanode-on-failure.enable,客户端在写失败的时候,是否使用更换策略,默认是true没有问题

对于,dfs.client.block.write.replace-datanode-on-failure.policy,default在3个或以上备份的时候,是会尝试更换结点尝试写入datanode。而在两个备份的时候,不更换datanode,直接开始写。对于3个datanode的集群,只要一个节点没响应写入就会出问题,所以可以关掉。

进入目录:

cd $HADOOP_HOME/etc/hadoop
vim hdfs-site.xml

添加内容:

<property>
        <name>dfs.client.block.write.replace-datanode-on-failure.enable</name>         <value>true</value>
    </property>

   

    <property>
    <name>dfs.client.block.write.replace-datanode-on-failure.policy</name>
        <value>NEVER</value>
    </property>

解决~

猜你喜欢

转载自blog.csdn.net/weixin_46211269/article/details/126576263