合并查看源代码

查看源代码  时间:2021-03-21  阅读:()
Hadoop元数据合并异常及解决方法这几天观察了一下StandbyNN上面的日志,发现每次Fsimage合并完之后,StandbyNN通知ActiveNN来下载合并好的Fsimage的过程中会出现以下的异常信息:2014-04-2314:42:54,964ERRORorg.
apache.
hadoop.
hdfs.
server.
namenode.
ha.
StandbyCheckpointer:ExceptionindoCheckpointjava.
net.
SocketTimeoutException:Readtimedoutatjava.
net.
SocketInputStream.
socketRead0(NativeMethod)atjava.
net.
SocketInputStream.
read(SocketInputStream.
java:152)atjava.
net.
SocketInputStream.
read(SocketInputStream.
java:122)atjava.
io.
BufferedInputStream.
fill(BufferedInputStream.
java:235)atjava.
io.
BufferedInputStream.
read1(BufferedInputStream.
java:275)atjava.
io.
BufferedInputStream.
read(BufferedInputStream.
java:334)atsun.
net.
www.
http.
HttpClient.
parseHTTPHeader(HttpClient.
java:687)atsun.
net.
www.
http.
HttpClient.
parseHTTP(HttpClient.
java:633)atsun.
net.
www.
protocol.
http.
HttpURLConnection.
getInputStream(HttpURLConnection.
java:1323)atjava.
net.
HttpURLConnection.
getResponseCode(HttpURLConnection.
java:468)atorg.
apache.
hadoop.
hdfs.
server.
namenode.
TransferFsImage.
doGetUrl(TransferFsImage.
java:268)atorg.
apache.
hadoop.
hdfs.
server.
namenode.
TransferFsImage.
getFileClient(TransferFsImage.
java:247)atorg.
apache.
hadoop.
hdfs.
server.
namenode.
TransferFsImage.
uploadImageFromStorage(TransferFsImage.
java:162)atorg.
apache.
hadoop.
hdfs.
server.
namenode.
ha.
StandbyCheckpointer.
doCheckpoint(StandbyCheckpointer.
java:174)atorg.
apache.
hadoop.
hdfs.
server.
namenode.
ha.
StandbyCheckpointer.
access$1100(StandbyCheckpointer.
java:53)atorg.
apache.
hadoop.
hdfs.
server.
namenode.
ha.
StandbyCheckpointer$CheckpointerThread.
doWork(StandbyCheckpointer.
java:297)atorg.
apache.
hadoop.
hdfs.
server.
namenode.
ha.
StandbyCheckpointer$CheckpointerThread.
access$300(StandbyCheckpointer.
java:210)atorg.
apache.
hadoop.
hdfs.
server.
namenode.
ha.
StandbyCheckpointer$CheckpointerThread$1.
run(StandbyCheckpointer.
java:230)atorg.
apache.
hadoop.
security.
SecurityUtil.
doAsLoginUserOrFatal(SecurityUtil.
java:456)atorg.
apache.
hadoop.
hdfs.
server.
namenode.
ha.
StandbyCheckpointer$CheckpointerThread.
run(StandbyCheckpointer.
java:226)1/5上面的代码贴出来有点乱啊,可以看下下面的图片截图:StandbyCheckpointer于是习惯性的去Google了一下,找了好久也没找到类似的信息.
只能自己解决.
我们通过分析日志发现更奇怪的问题,上次Checkpoint的时间一直都不变(一直都是StandbyNN启动的时候第一次Checkpoint的时间),如下:2014-04-2314:50:54,429INFOorg.
apache.
hadoop.
hdfs.
server.
namenode.
ha.
StandbyCheckpointer:Triggeringcheckpointbecauseithasbeen70164secondssincethelastcheckpoint,whichexceedstheconfiguredinterval600难道这是Hadoop的bug于是我就根据上面的错误信息去查看源码,经过仔细的分析,发现上述的问题都是由StandbyCheckpointer类输出的:privatevoiddoWork(){//Resetcheckpointtimesothatwedon'talwayscheckpoint//onstartup.
lastCheckpointTime=now();while(shouldRun){try{Thread.
sleep(1000*checkpointConf.
getCheckPeriod());}catch(InterruptedExceptionie){}if(!
shouldRun){break;}try{//Wemayhavelostourticketsincelastcheckpoint,loginagain,//justincaseif(UserGroupInformation.
isSecurityEnabled()){UserGroupInformation.
getCurrentUser().
checkTGTAndReloginFromKeytab();}longnow=now();longuncheckpointed=countUncheckpointedTxns();longsecsSinceLast=(now-lastCheckpointTime)/1000;2/5booleanneedCheckpoint=false;if(uncheckpointed>=checkpointConf.
getTxnCount()){LOG.
info("Triggeringcheckpointbecausetherehavebeen"+uncheckpointed+"txnssincethelastcheckpoint,which"+"exceedstheconfiguredthreshold"+checkpointConf.
getTxnCount());needCheckpoint=true;}elseif(secsSinceLast>=checkpointConf.
getPeriod()){LOG.
info("Triggeringcheckpointbecauseithasbeen"+secsSinceLast+"secondssincethelastcheckpoint,which"+"exceedstheconfiguredinterval"+checkpointConf.
getPeriod());needCheckpoint=true;}synchronized(cancelLock){if(now0){connection.
setConnectTimeout(timeout);connection.
setReadTimeout(timeout);}if(connection.
getResponseCode()!
=HttpURLConnection.
HTTP_OK){thrownewHttpGetFailedException("Imagetransferservletat"+url+"failedwithstatuscode"+connection.
getResponseCode()+"\nResponsemessage:\n"+connection.
getResponseMessage(),connection);}DFS_IMAGE_TRANSFER_TIMEOUT_KEY这个时间是由dfs.
image.
transfer.
timeout参数所设置的,默认值为10*60*1000,单位为毫秒.
然后我看了一下这个属性的解释:Timeoutforimagetransferinmilliseconds.
Thistimeoutandtherelateddfs.
image.
transfer.
bandwidthPerSecparametershouldbeconfiguredsuchthatnormalimagetransfercancompletewithinthetimeout.
Thistimeoutpreventsclienthangswhenthesender4/5failsduringimagetransfer,whichisparticularlyimportantduringcheckpointing.
Notethatthistimeoutappliestotheentiretyofimagetransfer,andisnotasockettimeout.
这才发现问题,这个参数的设置和dfs.
image.
transfer.
bandwidthPerSec息息相关,要保证ActiveNN在dfs.
image.
transfer.
timeout时间内把合并好的Fsimage从StandbyNN上下载完,要不然会出现异常.
然后我看了一下我的配置dfs.
image.
transfer.
timeout60000dfs.
image.
transfer.
bandwidthPerSec104857660秒超时,一秒钟拷贝1MB,而我的集群上的元数据有800多MB,显然是不能在60秒钟拷贝完,后来我把dfs.
image.
transfer.
timeout设置大了,观察了一下,集群再也没出现过上述异常信息,而且以前的一些异常信息也由于这个而解决了.
.
本博客文章除特别声明,全部都是原创!
原创文章版权归过往记忆大数据(过往记忆)所有,未经许可不得转载.
本文链接:【】()PoweredbyTCPDF(www.
tcpdf.
org)5/5

SugarHosts糖果主机商更换域名

昨天,遇到一个网友客户告知他的网站无法访问需要帮他检查到底是什么问题。这个同学的网站是我帮他搭建的,于是我先PING看到他的网站是不通的,开始以为是服务器是不是出现故障导致无法打开的。检查到他的服务器是有放在SugarHosts糖果主机商中,于是我登录他的糖果主机后台看到服务器是正常运行的。但是,我看到面板中的IP地址居然是和他网站解析的IP地址不同。看来官方是有更换域名。于是我就问 客服到底是什...

CYUN(29元/月)美国、香港、台湾、日本、韩国CN2,续费原价

关于CYUN商家在之前有介绍过一次,CYUN是香港蓝米数据有限公司旗下的云计算服务品牌,和蓝米云、蓝米主机等同属该公司。商家主要是为个人开发者用户、中小型、大型企业用户提供一站式核心网络云端部署服务,促使用户云端部署化简为零,轻松快捷运用云计算。目前,CYUN主要运营美国、香港、台湾、日本、韩国CN2线路产品,包括云服务器、站群服务器和独立服务器等。这次看到CYUN夏季优惠活动发布了,依然是熟悉的...

Hostiger发布哥伦布日提供VPS主机首月七折优惠 月费2.79美元

Hostiger商家我们可能以前也是有见过的,以前他们的域名是Hostigger,后来进行微调后包装成现在的。而且推出Columbus Day哥伦布日优惠活动,提供全场的VPS主机首月7折月付2.79美元起的优惠。这里我们普及一下基础知识,Columbus Day ,即为每年10月12日,是一些美洲国家的节日,纪念克里斯托弗·哥伦布在北美登陆,为美国的联邦假日。Hostiger 商家是一个成立于2...

查看源代码为你推荐
公司网络被攻击最近企业受到网络攻击的事件特别多,怎么才能有效地保护企业的网络安全呢?h连锁酒店什么连锁酒店好杨紫别祝我生日快乐一个人过生日的伤感说说有什么原代码源代码是什么意思啊月神谭求几个个性网名:www.7788dy.comwww.tom365.com这个免费的电影网站有毒吗?www.kanav001.com长虹V001手机小游戏下载的网址是什么百度指数词什么是百度指数百度指数词百度指数我创建的新词avtt4.comwww.51kao4.com为什么进不去啊?
广州服务器租用 美国vps推荐 德国vps 代理域名备案 申请免费域名 阿里云搜索 瓦工 便宜服务器 asp.net主机 息壤备案 cloudstack 哈喽图床 免费名片模板 华为云主机 炎黄盛世 已备案删除域名 北京双线 服务器干什么用的 百度云1t umax120 更多