最新文章專題視頻專題問(wèn)答1問(wèn)答10問(wèn)答100問(wèn)答1000問(wèn)答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問(wèn)答文章1 問(wèn)答文章501 問(wèn)答文章1001 問(wèn)答文章1501 問(wèn)答文章2001 問(wèn)答文章2501 問(wèn)答文章3001 問(wèn)答文章3501 問(wèn)答文章4001 問(wèn)答文章4501 問(wèn)答文章5001 問(wèn)答文章5501 問(wèn)答文章6001 問(wèn)答文章6501 問(wèn)答文章7001 問(wèn)答文章7501 問(wèn)答文章8001 問(wèn)答文章8501 問(wèn)答文章9001 問(wèn)答文章9501
當(dāng)前位置: 首頁(yè) - 科技 - 知識(shí)百科 - 正文

hadoop集群DataNode起不來(lái):“DiskChecker$DiskErrorExceptio

來(lái)源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-09 13:15:25
文檔

hadoop集群DataNode起不來(lái):“DiskChecker$DiskErrorExceptio

hadoop集群DataNode起不來(lái):DiskChecker$DiskErrorExceptio:最近把線上一個(gè)配置在拷貝到線下一臺(tái)機(jī)器后,發(fā)現(xiàn) hadoop datanode起不來(lái),總是報(bào)這個(gè)異常: 2014-03-11 10:38:44,238 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for block
推薦度:
導(dǎo)讀hadoop集群DataNode起不來(lái):DiskChecker$DiskErrorExceptio:最近把線上一個(gè)配置在拷貝到線下一臺(tái)機(jī)器后,發(fā)現(xiàn) hadoop datanode起不來(lái),總是報(bào)這個(gè)異常: 2014-03-11 10:38:44,238 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for block

最近把線上一個(gè)配置在拷貝到線下一臺(tái)機(jī)器后,發(fā)現(xiàn) hadoop datanode起不來(lái),總是報(bào)這個(gè)異常: 2014-03-11 10:38:44,238 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for block pool Block pool BP-1337291857-192.168.2.5

最近把線上一個(gè)配置在拷貝到線下一臺(tái)機(jī)器后,發(fā)現(xiàn)hadoop datanode起不來(lái),總是報(bào)這個(gè)異常:

2014-03-11 10:38:44,238 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for block pool Block pool BP-1337291857-192.168.2.50-1394505472069 (storage id DS-1593966629-192.168.2.50-50010-1394505524173) service to search002050.sqa.cm4/192.168.2.50:9000
org.apache.hadoop.util.DiskChecker$DiskErrorException: Invalid volume failure config value: 1
 at org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetImpl.
(FsDatasetImpl.java:183)
 at org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetFactory.newInstance
(FsDatasetFactory.java:34)
 at org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetFactory.newInstance
(FsDatasetFactory.java:30)
 at org.apache.hadoop.hdfs.server.datanode.DataNode.initStorage(DataNode.java:920)
 at org.apache.hadoop.hdfs.server.datanode.DataNode.initBlockPool(DataNode.java:882)
 at org.apache.hadoop.hdfs.server.datanode.BPOfferService.verifyAndSetNamespaceInfo
(BPOfferService.java:308)
 at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.connectToNNAndHandshake
(BPServiceActor.java:218)
 at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:660)
 at java.lang.Thread.run(Thread.java:662)

原因是:
dfs.datanode.failed.volumes.tolerated 這個(gè)參數(shù)直接拷貝了線上的配置為1,
其含義是:The number of volumes that are allowed to fail before a datanode stops offering service. By default any volume failure will cause a datanode to shutdown. 即datanode可以忍受的磁盤(pán)損壞的個(gè)數(shù)。

在hadoop集群中,經(jīng)常會(huì)發(fā)生磁盤(pán)只讀或者損壞的情況。datanode在啟動(dòng)時(shí)會(huì)使用dfs.datanode.data.dir下配置的文件夾(用來(lái)存儲(chǔ)block),若是有一些不可以用且個(gè)數(shù)>上面配置的值,DataNode就會(huì)啟動(dòng)失敗。

在線上環(huán)境中fs.datanode.data.dir配置為10塊盤(pán),所以dfs.datanode.failed.volumes.tolerated設(shè)置為1,是允許有一塊盤(pán)是壞的。而線下的只有一塊盤(pán),這volFailuresTolerated和volsConfigured的值都為1,所以會(huì)導(dǎo)致代碼里面判斷失敗。

詳見(jiàn)hadoop源碼的FsDatasetImpl.java的182行:

 // The number of volumes required for operation is the total number 
 // of volumes minus the number of failed volumes we can tolerate.
 final int volFailuresTolerated =
 conf.getInt(DFSConfigKeys.DFS_DATANODE_FAILED_VOLUMES_TOLERATED_KEY,
 DFSConfigKeys.DFS_DATANODE_FAILED_VOLUMES_TOLERATED_DEFAULT);
 String[] dataDirs = conf.getTrimmedStrings(DFSConfigKeys.DFS_DATANODE_DATA_DIR_KEY);
 int volsConfigured = (dataDirs == null) ? 0 : dataDirs.length;
 int volsFailed = volsConfigured - storage.getNumStorageDirs();
 this.validVolsRequired = volsConfigured - volFailuresTolerated;
 if (volFailuresTolerated < 0 || volFailuresTolerated >= volsConfigured) {
 throw new DiskErrorException("Invalid volume failure "
 + " config value: " + volFailuresTolerated);
 }
 if (volsFailed > volFailuresTolerated) {
 throw new DiskErrorException("Too many failed volumes - "
 + "current valid volumes: " + storage.getNumStorageDirs() 
 + ", volumes configured: " + volsConfigured 
 + ", volumes failed: " + volsFailed
 + ", volume failures tolerated: " + volFailuresTolerated);
 }

聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

hadoop集群DataNode起不來(lái):“DiskChecker$DiskErrorExceptio

hadoop集群DataNode起不來(lái):DiskChecker$DiskErrorExceptio:最近把線上一個(gè)配置在拷貝到線下一臺(tái)機(jī)器后,發(fā)現(xiàn) hadoop datanode起不來(lái),總是報(bào)這個(gè)異常: 2014-03-11 10:38:44,238 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for block
推薦度:
標(biāo)簽: error 不來(lái) 集群
  • 熱門(mén)焦點(diǎn)

最新推薦

猜你喜歡

熱門(mén)推薦

專題
Top