HDFS ha 格式化报错:a shared edits dir must not be specified if HA is not enabled.

Posted woofwoof

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HDFS ha 格式化报错:a shared edits dir must not be specified if HA is not enabled.相关的知识,希望对你有一定的参考价值。

错误内容:

Formatting using clusterid: CID-19921335-620f-4e72-a056-899702613a6b
2019-01-12 07:28:46,986 INFO namenode.FSEditLog: Edit logging is async:true
2019-01-12 07:28:47,043 INFO namenode.FSNamesystem: KeyProvider: null
2019-01-12 07:28:47,044 INFO namenode.FSNamesystem: fsLock is fair: true
2019-01-12 07:28:47,046 INFO namenode.FSNamesystem: Detailed lock hold time metrics enabled: false
2019-01-12 07:28:47,052 INFO namenode.FSNamesystem: fsOwner             = root (auth:SIMPLE)
2019-01-12 07:28:47,052 INFO namenode.FSNamesystem: supergroup          = supergroup
2019-01-12 07:28:47,052 INFO namenode.FSNamesystem: isPermissionEnabled = true
2019-01-12 07:28:47,053 INFO namenode.FSNamesystem: Determined nameservice ID: bi
2019-01-12 07:28:47,053 INFO namenode.FSNamesystem: HA Enabled: false
2019-01-12 07:28:47,053 WARN namenode.FSNamesystem: Configured NNs:
Nameservice <bi>:
  NN ID nn2 => MyLinux2/192.168.33.202:9000
2019-01-12 07:28:47,054 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:778)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:723)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1116)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1579)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1689)
2019-01-12 07:28:47,064 INFO namenode.FSNamesystem: Stopping services started for active state
2019-01-12 07:28:47,064 INFO namenode.FSNamesystem: Stopping services started for standby state
2019-01-12 07:28:47,064 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:778)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.<init>(FSNamesystem.java:723)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1116)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1579)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1689)
2019-01-12 07:28:47,071 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.
解决方法:
<property>
core-site.xml需要有这样类似的nameservices配置
<name>fs.defaultFS</name>
<value>hdfs://mycluster</value>
<description>HDFS的URI,文件系统://namenode标识:端口号</description>
</property>
<property>
<name>dfs.nameservices</name>
<value>mycluster</value>
</property>
 





































以上是关于HDFS ha 格式化报错:a shared edits dir must not be specified if HA is not enabled.的主要内容,如果未能解决你的问题,请参考以下文章

HDFS--(HA)初始化与启动

DataX Hdfs HA(高可用)配置支持

HADOOP HA 踩坑 - org.apache.hadoop.hdfs.qjournal.protocol.JournalNotFormattedException: Journal Storag

多个NameNode的HDFS集群切换HA后,Spark应用变得很慢的处理办法

Hadoop HA高可用

HadoopHDFS HA高可用