问题描述:
在格式化namenode时,显示报错如下
2024-03-07 13:55:30,543 ERROR namenode.FSNamesystem: FSNamesystem initialization failed.
java.io.IOException: Invalid configuration: a shared edits dir must not be specified if HA is not enabled.
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:794)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:735)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1180)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1645)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1755)
2024-03-07 13:55:30,549 INFO namenode.FSNamesystem: Stopping services started for active state
2024-03-07 13:55:30,549 INFO namenode.FSNamesystem: Stopping services started for standby state
2024-03-07 13:55:30,549 WARN namenode.NameNode: Encountered exception during format:
java.io.IOException: Invalid configuration: a shared edits dir must not be specified if HA is not enabled.
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:794)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:735)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1180)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1645)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1755)
2024-03-07 13:55:30,549 ERROR namenode.NameNode: Failed to start namenode.
java.io.IOException: Invalid configuration: a shared edits dir must not be specified if HA is not enabled.
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:794)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:735)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1180)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1645)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1755)
2024-03-07 13:55:30,550 INFO util.ExitUtil: Exiting with status 1: java.io.IOException: Invalid configuration: a shared edits dir must not be specified if HA is not enabled.
问题分析:
根据报错"如果未启用ha,则不得指定共享编辑目录"提示定位到./hdfs-site.xml文件。在hdfs-site.xml文件中配置过两个共享目录,分别是journalnode namenode,查看后发现journalnode.edits多输入一个t
问题解决:
删除多余的t,重新分发hadoop到salve1 slave2节点
再次进行namenode格式化
格式化成功问题解决文章来源:https://www.toymoban.com/news/detail-851507.html
总结:
在修改配置文件部分一定要细心,namenode格式化过程中报错大多都是配置文件写错了。根据报错找到对应文件进行修改。文章来源地址https://www.toymoban.com/news/detail-851507.html
到了这里,关于Hadoop HA 搭建过程中报错:namenode格式化的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!