HDFS超租约异常总结(org.apache.hadoop.hdfs.server.namenode.LeaseExpiredException)
发布日期:2021-07-12 08:49:07 浏览次数:8 分类:技术文章

本文共 1918 字,大约阅读时间需要 6 分钟。

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

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

异常信息:

13/09/11 12:12:06 INFO hdfs.DFSClient: SMALL_BUFFER_SIZE is 512org.apache.hadoop.ipc.RemoteException: org.apache.hadoop.hdfs.server.namenode.LeaseExpiredException: No lease 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 " + curXceiverCount59                               + " exceeds the limit of concurrent xcievers "60                               + dataXceiverServer.maxXceiverCount);61       }

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

解决方案:

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

转载于:https://www.cnblogs.com/wq3435/p/7812115.html

转载地址:https://blog.csdn.net/ankan7400/article/details/102088914 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Jenkins之构建触发器配置(转载)
下一篇:Spring MVC配置文件的三个常用配置详解

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年04月02日 00时42分03秒