虚拟机启动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安装目录下文章来源:https://www.toymoban.com/news/detail-504276.html
cd /opt/programs/hadoop-2.7.2/
scp -r tmp/ root@hadoop02:/opt/programs/hadoop-2.7.2
#启动hadoop文章来源地址https://www.toymoban.com/news/detail-504276.html
start-dfs.sh
start-yarn.sh
到了这里,关于hadoop namenode格式化错误以及启动不了解决方案的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!