org.apache.hadoop.hdfs.server.namenode.LeaseExpiredException: No leas e on

来源:互联网 发布:qq号定位软件 编辑:程序博客网 时间:2024/05/27 01:10

异常信息:

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并重启集群

参照该步骤并没有起作用,检查程序进程,发现有其他的重复程序运行干扰,导致重复读写删除。

该错误应该不会导致程序异常退出。

阅读全文
0 0
原创粉丝点击