有段时间不写博客了,感觉自己懒惰了不少,当然也是不够努力。近一年的时间一直在开发Hadoop基础应用。 



  新的项目上线之后发现,有些会员上传资源到我们集群的速度,既然跟我们集群的吞吐量差不多,达到了70M+/s的速度。 在向集群put数据时,抛出了异常:

  1. nodes, instead of 1

这样的信息告诉我,集群内部无可用的节点了,因为是在put阶段出现的,直觉告诉我,所有的节点是不是都已经写满数据了? 



节点少的情况比较容易观察Hadoop的一些问题,查看dfshealth.jsp页面发现,至少有三台节点可写,但dfsClient put数据仍然抛出无节点可用的异常。 



追究源码,NameNode身边的 ReplicationTargetChooser#isGoodTarget方法给出了说明:

  1. // check the communication traffic of the target machine
  2. if (considerLoad) {
  3. ;
  4. int size = clusterMap.getNumOfLeaves();
  5. ) {
  6. avgLoad = (double)fs.getTotalLoad()/size;
  7. }
  8. if (node.getXceiverCount() > (2.0 * avgLoad)) {
  9. logr.debug("Node "+NodeBase.getPath(node)+
  10. " is not chosen because the node is too busy");
  11. return false;
  12. }
  13. }

isGoodTarget方法对预选的数据节点做出了终审判决,然而除了磁盘空间可利用外,另外需稳定在一定的压力之下,这里的标准是Datanode中XceiverServer所接受的连接数,我们在使用Hadoop时,这个值很容易被忽略,因为这个值不方便被统计到。上段代码说明当前节点的连接数,不得大于集群所有节点平均连接数的两倍。为了使我的系统尽量独力,我在dfshealth.jsp 页面把每台节点的连接数打印了出来,结果发现正好符合上述代码的判断。 



 



比如ReplicationTargetChooser选择了node13,那么即使node13有大片的空间可写,最终也会被上述代码认为是一个不符合条件的节点。

  1. > ((27 + 45 + 44 + 54 + 35 + 50 + 104 + 55 + 73 + 69 + 157 + 146)/12 * 2)

这样的异常,一般解决办法是添加节点,或是在节点允许的情况下,对这段算法进行上调。 

hadoop异常:Be Replicated to 0 nodes, instead of 1的更多相关文章

  1. Hadoop上传文件时报错: could only be replicated to 0 nodes instead of minReplication (=1)....

    问题 上传文件到Hadoop异常,报错信息如下: org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /home/inpu ...

  2. hadoop fs -put localfile . 时出现如下错误: could only be replicated to 0 nodes, instead of 1

    hadoop fs -put localfile . 时出现如下错误:could only be replicated to 0 nodes, instead of 1网友的说法: 这个问题是由于没有 ...

  3. hadoop:could only be replicated to 0 nodes, instead of 1

    在Hadoop的环境搭建过程中,常常会遇到类似这样的错误信息提示:“could only be replicated to 0 nodes, instead of 1 ”,产生这样的错误原因有多种,这 ...

  4. 【大数据系列】hadoop上传文件报错_COPYING_ could only be replicated to 0 nodes

    使用hadoop上传文件 hdfs dfs -put  XXX 17/12/08 17:00:39 WARN hdfs.DFSClient: DataStreamer Exception org.ap ...

  5. 运行时候报异常could only be replicated to 0 nodes instead of minReplication (=1). There are 2 datanode(s) running and no node(s) are excluded in this operation.

    运行时候报异常could only be replicated to 0 nodes instead of minReplication (=1).  There are 2 datanode(s) ...

  6. hadoop报错:could only be replicated to 0 nodes, instead of 1

    错误 [root@hadoop test]# hadoop jar hadoop.jarcom.hadoop.hdfs.CopyToHDFS 14/01/26 10:20:00 WARN hdfs.D ...

  7. hadoopmaster主机上传文件出错: put: File /a.txt._COPYING_ could only be replicated to 0 nodes instead of minReplication (=1). There are 3 datanode(s) running and 3 node(s) are excluded in this operation.

    刚开始装好hadoop的时候,namenode机上传文件没有错误,今天打开时突然不能上传文件,报错 put: File /a.txt._COPYING_ could only be replicate ...

  8. File /hbase/.tmp/hbase.version could only be replicated to 0 nodes instead of minReplication (=1).

    File /hbase/.tmp/hbase.version could only be replicated to 0 nodes instead of minReplication (=1). 这 ...

  9. org.apache.hadoop.ipc.RemoteException: java.io.IOException:XXXXXXXXXXX could only be replicated to 0 nodes, instead of 1

    原因:Configured Capacity也就是datanode 没用分配容量 [root@dev9106 bin]# ./hadoop dfsadmin -report Configured Ca ...

随机推荐

  1. [Bzoj3172][Tjoi2013]单词(fail树)

    3172: [Tjoi2013]单词 Time Limit: 10 Sec  Memory Limit: 512 MBSubmit: 4777  Solved: 2345[Submit][Status ...

  2. Liunx常用命令(备用)

    常用指令 ls        显示文件或目录 -l           列出文件详细信息l(list) -a          列出当前目录下所有文件及目录,包括隐藏的a(all) mkdir     ...

  3. 算法 - 求两个自然数的最大公约数(C++)

    //************************************************************************************************** ...

  4. Wide & Deep Learning Model

    Generalized linear models with nonlinear feature transformations (特征工程 + 线性模型) are widely used for l ...

  5. Android6.0权限管理以及使用权限该注意的地方

    Android 6.0 Marshmallow首次增加了执行时权限管理,这对用户来说,能够更好的了解.控 制 app 涉及到的权限.然而对开发人员来说却是一件比較蛋疼的事情.须要兼容适配,并保证程序功 ...

  6. 紫书p199 八数码(BFS,hash)

    八数码问题  紫书上的简单搜索  渣渣好久才弄懂 #include<cstdio> #include<cstring> using namespace std; const i ...

  7. android studio——Could not find method externalNativeBuild()

    gradle同步工程时出现错误 Error:(36, 0) Could not find method externalNativeBuild() for arguments [build_cazi7 ...

  8. three.js 源代码凝视(十五)Math/Plane.js

    商域无疆 (http://blog.csdn.net/omni360/) 本文遵循"署名-非商业用途-保持一致"创作公用协议 转载请保留此句:商域无疆 -  本博客专注于 敏捷开发 ...

  9. 读取xml生成lua測试代码

    #include <iostream> #include <string> #include <fstream> #include "tinyxml2.h ...

  10. HashMap变成线程安全方法

    我们都知道.HashMap是非线程安全的(非同步的).那么怎么才能让HashMap变成线程安全的呢? 我认为主要可以通过以下三种方法来实现: 1.替换成Hashtable,Hashtable通过对整个 ...