美文网首页
Hadoop重启,部分进程没有成功开启

Hadoop重启,部分进程没有成功开启

作者: analanxingde | 来源:发表于2019-04-10 20:24 被阅读0次

    一段时间后,重新启动hadoop之后,没有显示应有的五个进程。一般情况下从logs目录出发,进行修改。最经常报的错误是:

    1. 端口绑定失败

    这种情况下一般是端口占用,执行命令netstat -anp |grep 端口号,查看占用该端口的进程,并执行kill 9 进程号,再次重启即可。

    2. datanode报错信息如下

    2019-04-10 20:06:07,948 WARN org.apache.hadoop.hdfs.server.common.Storage: Failed to add storage directory [DISK]file:/root/hadoop/dfs/data/
    java.io.IOException: Incompatible clusterIDs in /root/hadoop/dfs/data: namenode clusterID = CID-deb400ff-00be-4e84-b647-6be4edbe6abb; datanode clusterID = CID-83f6523b-7765-4eb1-abde-5887636778c9
        at org.apache.hadoop.hdfs.server.datanode.DataStorage.doTransition(DataStorage.java:760)
        at org.apache.hadoop.hdfs.server.datanode.DataStorage.loadStorageDirectory(DataStorage.java:293)
        at org.apache.hadoop.hdfs.server.datanode.DataStorage.loadDataStorage(DataStorage.java:409)
        at org.apache.hadoop.hdfs.server.datanode.DataStorage.addStorageLocations(DataStorage.java:388)
        at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:556)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.initStorage(DataNode.java:1574)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.initBlockPool(DataNode.java:1535)
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.verifyAndSetNamespaceInfo(BPOfferService.java:382)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.connectToNNAndHandshake(BPServiceActor.java:266)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:750)
        at java.lang.Thread.run(Thread.java:748)
    2019-04-10 20:06:07,950 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Block pool ID needed, but service not yet registered with NN, trace:
    java.lang.Exception
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.getBlockPoolId(BPOfferService.java:210)
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.hasBlockPoolId(BPOfferService.java:220)
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.shouldRetryInit(BPOfferService.java:826)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.shouldRetryInit(BPServiceActor.java:792)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:755)
        at java.lang.Thread.run(Thread.java:748)
    2019-04-10 20:06:07,950 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool <registering> (Datanode Uuid 360e4398-6fcd-409e-bab7-15207af21561) service to test01/172.17.15.27:9000. Exiting. 
    java.io.IOException: All specified directories are failed to load.
        at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:557)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.initStorage(DataNode.java:1574)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.initBlockPool(DataNode.java:1535)
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.verifyAndSetNamespaceInfo(BPOfferService.java:382)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.connectToNNAndHandshake(BPServiceActor.java:266)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:750)
        at java.lang.Thread.run(Thread.java:748)
    2019-04-10 20:06:07,951 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Ending block pool service for: Block pool <registering> (Datanode Uuid 360e4398-6fcd-409e-bab7-15207af21561) service to test01/172.17.15.27:9000
    2019-04-10 20:06:08,061 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Block pool ID needed, but service not yet registered with NN, trace:
    java.lang.Exception
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.getBlockPoolId(BPOfferService.java:210)
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.hasBlockPoolId(BPOfferService.java:220)
        at org.apache.hadoop.hdfs.server.datanode.BlockPoolManager.remove(BlockPoolManager.java:90)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.shutdownBlockPool(DataNode.java:1490)
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.shutdownActor(BPOfferService.java:465)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.cleanUp(BPServiceActor.java:527)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:787)
        at java.lang.Thread.run(Thread.java:748)
    2019-04-10 20:06:08,061 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Removed Block pool <registering> (Datanode Uuid 360e4398-6fcd-409e-bab7-15207af21561)
    2019-04-10 20:06:08,061 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Block pool ID needed, but service not yet registered with NN, trace:
    java.lang.Exception
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.getBlockPoolId(BPOfferService.java:210)
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.hasBlockPoolId(BPOfferService.java:220)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.shutdownBlockPool(DataNode.java:1491)
        at org.apache.hadoop.hdfs.server.datanode.BPOfferService.shutdownActor(BPOfferService.java:465)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.cleanUp(BPServiceActor.java:527)
        at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:787)
        at java.lang.Thread.run(Thread.java:748)
    2019-04-10 20:06:10,074 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Exiting Datanode
    2019-04-10 20:06:10,076 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 0
    2019-04-10 20:06:10,129 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG:
    

    根据报错信息java.io.IOException: Incompatible clusterIDs in /root/hadoop/dfs/data: namenode clusterID = CID-deb400ff-00be-4e84-b647-6be4edbe6abb; datanode clusterID = CID-83f6523b-7765-4eb1-abde-5887636778c9博客可知,namenode和datanode的clusterID不同造成的解决办法:
    根据日志中的路径,cd /root/hadoop/dfs/下面有data和name两个文件夹,
    /root/hadoop/dfs/name/current下的VERSION中的clusterID覆盖掉/root/hadoop/dfs/data/current下的VERSION的clusterID即可。

    全部修改完毕后,重启即可。


    Hadoop成功启动

    相关文章

      网友评论

          本文标题:Hadoop重启,部分进程没有成功开启

          本文链接:https://www.haomeiwen.com/subject/ycwcmqtx.html