2

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?

2 Answers 2

0

After applying the configuration (see Configuration details paragraph) defined in this documentation the issue HA is not enabled for this namenode was solved.

<property>
  <name>dfs.namenode.rpc-address.mycluster.nn1</name>
  <value>machine1.example.com:8020</value>
</property>
<property>
  <name>dfs.namenode.rpc-address.mycluster.nn2</name>
  <value>machine2.example.com:8020</value>
</property>

Applying the other configuration settings on respectively the ActiveNN and StandyNN converted HDFS from non-HA to HA.

0

For me the error HA is not enabled for this namenode was resolved when I corrected the hdfs-site.xml config file, where I had mistakenly mentioned 3 namenode-id for a single nameservice-id.

Ha configuration accepts only 2 namenode-ids.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .