合并查看源代码

查看源代码  时间: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

香港ceranetworks(69元/月) 2核2G 50G硬盘 20M 50M 100M 不限流量

香港ceranetworks提速啦是成立于2012年的十分老牌的一个商家这次给大家评测的是 香港ceranetworks 8核16G 100M 这款产品 提速啦老板真的是豪气每次都给高配我测试 不像别的商家每次就给1核1G,废话不多说开始跑脚本。香港ceranetworks 2核2G 50G硬盘20M 69元/月30M 99元/月50M 219元/月100M 519元/月香港ceranetwork...

港云网络(¥1/月活动机器),香港CN2 4核4G 1元/月 美国CN2

港云网络官方网站商家简介港云网络成立于2016年,拥有IDC/ISP/云计算资质,是正规的IDC公司,我们采用优质硬件和网络,为客户提供高速、稳定的云计算服务。公司拥有一流的技术团队,提供7*24小时1对1售后服务,让您无后顾之忧。我们目前提供高防空间、云服务器、物理服务器,高防IP等众多产品,为您提供轻松上云、安全防护。点击进入港云网络官方网站港云网络中秋福利1元领【每人限量1台】,售完下架,活...

什么是BGP国际线路及BGP线路有哪些优势

我们在选择虚拟主机和云服务器的时候,是不是经常有看到有的线路是BGP线路,比如前几天有看到服务商有国际BGP线路和国内BGP线路。这个BGP线路和其他服务线路有什么不同呢?所谓的BGP线路机房,就是在不同的运营商之间通过技术手段时间各个网络的兼容速度最佳,但是IP地址还是一个。正常情况下,我们看到的某个服务商提供的IP地址,在电信和联通移动速度是不同的,有的电信速度不错,有的是移动速度好。但是如果...

查看源代码为你推荐
关键字编程中,什么是关键字刘祚天DJ这个职业怎么样?rawtoolsU盘显示是RAW格式怎么办梦遗姐昨晚和姐姐和她朋友一起吃晚饭,我们都喝了酒,我迷糊着回到家的,早上我回想起我好像发生关系射过,会不会是我姐姐,如果是这样我怎么办www.884tt.com刚才找了个下电影的网站www.ttgame8.com,不过好多电影怎么都不能用QQ旋风或者是迅雷下在呢?鹤城勿扰齐齐哈尔电视台晴彩鹤城是哪个频道www.bbbb.com二级域名怎么申请?看URL怎么分辨出二级域名、三级域名莱姿蔓不蔓不枝的蔓是什么意思酒仙琐事"酒仙"指的是什么人?m.yushuwu.comhttp www.jiaoyucard.com用户名怎么填
广州服务器租用 80vps 香港加速器 arvixe 免备案空间 win8升级win10正式版 河南服务器 小米数据库 七夕促销 免费mysql数据库 太原联通测速 江苏徐州移动 带宽测试 博客域名 贵州电信 cpu使用率过高怎么办 时间同步服务器 傲盾代理 西部主机 卡巴斯基官方下载 更多