In earlier releases, the NameNode was a single point of failure (SPOF) in a HDFS cluster. Each cluster had a single NameNode, and if that machine or process became unavailable, the cluster as a whole would be unavailable until the NameNode was either restarted or brought up on a separate machine. The Secondary NameNode did not provide failover capability. The HA architecture solved this problem of NameNode availability by allowing us to have two NameNodes in an active/passive configuration. The NameNode is the centerpiece of an HDFS file system

To enable Namenode HA in cloudera, you must ensure that the two nodes are of same configuration in terms of memory, disk, etc for optimal performance. Here are the steps.

ZooKeeper:

First of install “ZooKeeper to set up HA for NameNode.

Select cluster -> Action -> Add Service and pop will appear.

HA2

Add zookeeper from listed services.

HA3

Add ZooKeeper to 3 servers.

HA4HA5

Add Zookeeper service to Cluster and click next.

HA6

Next step will initialize and start the ZooKeeper services. Click Next and ZooKeeper service successfully added to the cluster.

HDFS HA set up:

Now select the HDFS Service from cluster and see the status page.

Select Action -> Enable HA option.

HA11.PNG

Give Nameservice Name and click next.

HA12

Now select the location of Second NameNode service. In my case, I selected RM as a secondary NN location and 3 X JournalNodes (Odd Numbers are Required for OJM. See here for more information.

HA15

HA13

Now change the directory for Journal Nodes edit.

HA16

click next and you can see the progress steps.

HA17

NameNode formatting step will fail, that is fine. Wait till all the steps get finished.

HA19

Now its completed.

HA20

You can see the Active/Passive Node set up as below.

HA24

See the ZooKeeper status and one will be the leader and others as followers.

HA23

HA Test:

HA test is very simple and quick.  Check the status NameNodes services and select active Name Node -> action for selected -> stop.

Now check the status and after few seconds, the standby node will come up as active node.

Now start the stopped NN service and will come up as standby NN service after a while.

HA28

Setup HA for YARN:

Go to the YARN service.

YARN_HA.PNG

Select Action “enable high availability”.

YARN_HA2.PNG

Select Second node for YARN service. I selected CM node.

YAR_HA3.PNG

YARN_HA4.PNG

Click next and it’ll enable the HA.

YARN_HA6.PNG

Now go to the ResourceManager you’ll see both Active/Passive RM nodes.

YARN_HA7

Once you have configured the YARN resource manager for HA, if the active resource manager is down or is no longer on the list, one of the standby resource managers becomes active and resumes resource manager responsibilities. This way, jobs continue to run and complete successfully.

 

 

Leave a Reply