zoukankan      html  css  js  c++  java
  • HDFS超租约异常总结(org.apache.hadoop.hdfs.server.namenode.LeaseExpiredException)

    HDFS超租约异常总结(org.apache.hadoop.hdfs.server.namenode.LeaseExpiredException)

    转载 2014年02月22日 14:40:58

    异常信息:

    13/09/11 12:12:06 INFO hdfs.DFSClient: SMALL_BUFFER_SIZE is 512
    org.apache.hadoop.ipc.RemoteException: org.apache.hadoop.hdfs.server.namenode.LeaseExpiredException: No leas
    e on /tmp/put_dir/20130911-121205-858/ie_ping1_access_log.2013091111.lzo File does not exist. Holder DFSClient_-2082829022 does not have any open files.
            at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkLease(FSNamesystem.java:1623)
            at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkLease(FSNamesystem.java:1614)
            at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.completeFileInternal(FSNamesystem.java:1669)
            at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.completeFile(FSNamesystem.java:1657)
            at org.apache.hadoop.hdfs.server.namenode.NameNode.complete(NameNode.java:714)

    字面理解为文件操作超租期,实际上就是data stream操作过程中文件被删掉了。之前也遇到过,通常是因为Mapred多个task操作同一个文件,一个task完成后删掉文件导致。

    不过这次在hdfs上传文件时发生了这个异常,导致上传失败。google了一把,有人反馈跟dfs.datanode.max.xcievers参数到达上限有关。这个是datanode处理请求的任务

    上限,默认为256,集群上面配置为2048.于是去所有datanode上面扫了一下log,发现果然出现了IOE:

    java.io.IOException: xceiverCount 2049 exceeds the limit of concurrent xcievers 2048

    翻源码找了一下xcievers,有DataXcievers和DataXcieversServer两个类,DataXcievers是DataXcieversServer启动的一个线程,用于处理输入输出数据流,其run()

    方法有如下判断:

    复制代码
     1   public void run() {
     2          ...
    56       int curXceiverCount = datanode.getXceiverCount();
    57       if (curXceiverCount > dataXceiverServer.maxXceiverCount) {
    58         throw new IOException("xceiverCount " + curXceiverCount
    59                               + " exceeds the limit of concurrent xcievers "
    60                               + dataXceiverServer.maxXceiverCount);
    61       }
    复制代码

    xcievers超过限制抛了一个IOException,这反应到DFSClient端,就是正在操作的文件失去了响应,于是就出现了上面的租约超期异常。

    解决方案:

    继续改大 xceiverCount 至8192并重启集群生效。

  • 相关阅读:
    8 -- 深入使用Spring -- 5...3 使用@CacheEvict清除缓存
    8 -- 深入使用Spring -- 5...2 使用@Cacheable执行缓存
    tomcat 的 server.xml配置文件
    WEB-INF目录与META-INF目录的作用
    一个tomcat设置多个端口,多个端口对应多个应用
    8 -- 深入使用Spring -- 5...1 启用Spring缓存
    8 -- 深入使用Spring -- 5... Spring 3.1 新增的缓存机制
    8 -- 深入使用Spring -- 4...6 AOP代理:基于注解的XML配置文件的管理方式
    eclipse中设置文件的编码格式为utf-8
    MySQL 触发器简单实例
  • 原文地址:https://www.cnblogs.com/wq3435/p/7812115.html
Copyright © 2011-2022 走看看