分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 代码编程

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

发布时间:2023-09-06 01:24责任编辑:白小东关键词:apache

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

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

原文地址:http://www.cnblogs.com/wq3435/p/7812115.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved