zoukankan      html  css  js  c++  java
  • hadoop append 追加文件错误

    
    
    1. java.io.IOException:Failed to replace a bad datanode on the existing pipeline due to no more good datanodes being available to try.(Nodes: current=[DatanodeInfoWithStorage[192.168.168.200:50010,DS-039c3e9e-2b2a-44e8-9f3e-8584b6c3f2c3,DISK]], original=[DatanodeInfoWithStorage[192.168.168.200:50010,DS-039c3e9e-2b2a-44e8-9f3e-8584b6c3f2c3,DISK]]).The current failed datanode replacement policy is DEFAULT,and a client may configure this via 'dfs.client.block.write.replace-datanode-on-failure.policy'in its configuration.
    原因:无法写入;我的环境中有3个datanode,备份数量设置的是3。在写操作时,它会在pipeline中写3个机器。默认replace-datanode-on-failure.policy是DEFAULT,如果系统中的datanode大于等于3,它会找另外一个datanode来拷贝。目前机器只有3台,因此只要一台datanode出问题,就一直无法写入成功。
     
    解决办法:修改hdfs-site.xml文件,添加或者修改如下两项: 
    
    
    1. <property>
    2.   <name>dfs.client.block.write.replace-datanode-on-failure.enable</name>
    3.   <value>true</value>
    4. </property>
    5. <property>
    6.   <name>dfs.client.block.write.replace-datanode-on-failure.policy</name>
    7.   <value>NEVER</value>
    8. </property>
    对于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的集群,只要一个节点没响应写入就会出问题,所以可以关掉。/ 
    或者在客户端的代码里面加入:   
    
    
    1. conf =newConfiguration();
    2. conf.set("dfs.client.block.write.replace-datanode-on-failure.policy","NEVER"); 
    3. conf.set("dfs.client.block.write.replace-datanode-on-failure.enable","true"); 
  • 相关阅读:
    c# 服务
    c#调用腾讯云API的实例
    c#的WebService和调用
    基于H5的WebSocket简单实例
    Windows server 2008 R2配置多个远程连接
    把本地项目上传到git服务器的步骤
    swagger-ui中@ApiOperation实例
    VUE学习系列--(一)
    IntelliJ IDEA自动添加类注释和方法注释
    Jeecg-Cloud学习之路(二)
  • 原文地址:https://www.cnblogs.com/yangcx666/p/8723864.html
Copyright © 2011-2022 走看看