Introduction
Aim: Convert HDFS from non-HA to HA.
Method: According to this documentation it should be possible to convert HFDS from non- to HA by implementing following configuration:
/etc/hadoop/conf/hdfs-site.xml
<property>
<name>dfs.ha.automatic-failover.enabled</name>
<value>true</value>
</property>
/etc/hadoop/conf/core-site.xml
<property>
<name>ha.zookeeper.quorum</name>
<value>localhost:2181</value>
</property>
and executing following commands:
sudo service hadoop-hdfs-journalnode start
sudo service hadoop-hdfs-zkfc start
hdfs namenode -initializeSharedEdits
sudo -u hdfs hdfs namenode -bootstrapStandby
sudo service hadoop-hdfs-namenode start
Results:
14/06/09 15:37:15 FATAL namenode.NameNode: Exception in namenode join
java.io.IOException: org.apache.hadoop.HadoopIllegalArgumentException: HA is not enabled for this namenode.
at org.apache.hadoop.hdfs.server.namenode.ha.BootstrapStandby.run(BootstrapStandby.java:310)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1154)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1241)
Caused by: org.apache.hadoop.HadoopIllegalArgumentException: HA is not enabled for this namenode.
at org.apache.hadoop.hdfs.server.namenode.ha.BootstrapStandby.parseConfAndFindOtherNN(BootstrapStandby.java:261)
at org.apache.hadoop.hdfs.server.namenode.ha.BootstrapStandby.run(BootstrapStandby.java:92)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
at org.apache.hadoop.hdfs.server.namenode.ha.BootstrapStandby.run(BootstrapStandby.java:305)
... 2 more
14/06/09 15:37:15 INFO util.ExitUtil: Exiting with status 1
14/06/09 15:37:15 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1
************************************************************/
Question
How to convert HDFS from non-HA to HA?