0


hadoop namenode格式化错误以及启动不了解决方案

虚拟机启动hadoop无法启动

2022-10-24 10:43:41,743 WARN  [main] namenode.NameNode (NameNode.java:format(1204))- Encountered exception during format: 
org.apache.hadoop.hdfs.qjournal.client.QuorumException: Unable to check if JNs are ready for formatting. 1 exceptions thrown:
192.168.40.201:8485: Call From c701/192.168.40.201 to c701:8485 failed on connection exception: java.net.ConnectException: 拒绝连接;For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused
    at org.apache.hadoop.hdfs.qjournal.client.QuorumException.create(QuorumException.java:81)
    at org.apache.hadoop.hdfs.qjournal.client.QuorumCall.rethrowException(QuorumCall.java:287)
    at org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager.hasSomeData(QuorumJournalManager.java:282)
    at org.apache.hadoop.hdfs.server.common.Storage.confirmFormat(Storage.java:1142)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.confirmFormat(FSImage.java:209)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1198)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1645)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1755)
2022-10-24 10:43:41,846 ERROR [main] namenode.NameNode (NameNode.java:main(1760))- Failed to start namenode.
org.apache.hadoop.hdfs.qjournal.client.QuorumException: Unable to check if JNs are ready for formatting. 1 exceptions thrown:
192.168.40.201:8485: Call From c701/192.168.40.201 to c701:8485 failed on connection exception: java.net.ConnectException: 拒绝连接;For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused
    at org.apache.hadoop.hdfs.qjournal.client.QuorumException.create(QuorumException.java:81)
    at org.apache.hadoop.hdfs.qjournal.client.QuorumCall.rethrowException(QuorumCall.java:287)
    at org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager.hasSomeData(QuorumJournalManager.java:282)
    at org.apache.hadoop.hdfs.server.common.Storage.confirmFormat(Storage.java:1142)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.confirmFormat(FSImage.java:209)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1198)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1645)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1755)

重启虚拟机,启动Zookeeper和journalnode
启动三台机器的zookeeper 和 journalnode

zkServer.sh start
hadoop-daemon.sh start journalnode

第一次格式化namenode时报错,namennode可能会自动进入了安全模式,所以需要关闭安全模式

hadoop dfsadmin -safemode leave    #关闭safe mode

重新格式化

hdfs namenode -format

hadoop中namenode无法启动

需要先关闭所有服务

stop-all.sh 

查看配置文件是否有错误
然后删除tmp文件,并重新格式化namenode,tmp文件查看core-site.xml文件配置的位置我的位置是/opt/programs/hadoop-2.7.2/tmp

rm-rf /opt/programs/hadoop-2.7.2/tmp

三台机器分别启动zookeeper ,journalnode和关闭安全模式

zkServer.sh start
hadoop-daemon.sh start journalnode
hadoop dfsadmin -safemode leave

格式化Namenode

cd /opt/programs/hadoop-2.7.2   #先进入Hadoop的根目录   
hdfs namenode -format

执行命令,将hadoop01节点Hadoop安装目录下的tmp文件夹远程复制到hadoop02节点的Hadoop安装目录下

cd /opt/programs/hadoop-2.7.2/
scp -r tmp/ root@hadoop02:/opt/programs/hadoop-2.7.2

#启动hadoop

start-dfs.sh
start-yarn.sh

本文转载自: https://blog.csdn.net/weixin_45942827/article/details/127500373
版权归原作者 山乀 所有, 如有侵权,请联系我们删除。

“hadoop namenode格式化错误以及启动不了解决方案”的评论:

还没有评论