• 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并重启集群生效。

  • 相关阅读:
    【咸鱼教程】基于系统时间的计时器DateTimer(不受FPS影响)
    【咸鱼教程】Egret实现摇一摇功能
    【咸鱼教程】可自动滚动的聊天文本框
    【咸鱼教程】虚拟摇杆
    【咸鱼教程】一个简单的画布(阴阳师画符)
    【咸鱼教程】震屏效果
    【咸鱼教程】一个简单的弹出二级菜单UIPopupMenu
    【咸鱼教程】微信网页授权(获取用户头像、昵称等)
    【咸鱼教程】TextureMerger1.6.6 三:Bitmap Font的制作和使用
    【咸鱼教程】TextureMerger1.6.6 二:Sprite Sheet的制作和使用
  • 原文地址:https://www.cnblogs.com/wq3435/p/7812115.html
Copyright © 2020-2023  润新知