Hadoop: Secondary NameNode

(Last Updated On: )

By default a secondary namenode runs on the main namenode server. This is not ideal. A secondary namenode should be on it’s own server.

First bring up a new server that has the exact same configuration as the primary namenode.

Secondary NameNode:

nano /usr/local/hadoop/etc/hadoop/hdfs-site.xml

Remove property “dfs.namenode.secondary.http-address” and “dfs.namenode.name.dir” as they are unneeded.

Then add the following property. Making sure to change to the path you will store your checkpoints in.

<property>
    <name>dfs.namenode.checkpoint.dir</name>
    <value>file:/usr/local/hadoop_store/data/checkpoint</value>
</property>

NameNode:

nano /usr/local/hadoop/etc/hadoop/hdfs-site.xml

Then add the following property. Making sure to change ##SECONDARYNAMENODE##

<property>
    <name>dfs.namenode.secondary.http-address</name>
    <value>##SECONDARYNAMENODE##:50090</value>
    <description>Your Secondary NameNode hostname for http access.</description>
</property>

Now when you stop and start the cluster you will see the secondary name node now start on the secondary server and not on the primary namenode server. This is what you want.

 

2 thoughts on “Hadoop: Secondary NameNode”

Comments are closed.