Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Question on Namenode services failover

Question on Namenode services failover

Expert Contributor

we have few application connecting to our cluster through name node.

Currently they are connecting to the active name node. but when failover happens they would have to modify their connection string manually.

is there a better way to handle this situation without any manual intervention ?

2 REPLIES 2

Re: Question on Namenode services failover

Super Mentor

@Kumar Veerappan

In your Hadoop Client code you should use the NameService instead of the individual NN1 and NN2

Example:

conf.set("dfs.nameservices", nameserviceId);
conf.set("dfs.ha.namenodes."+ nameserviceId, "nn1,nn2");
conf.set("dfs.namenode.rpc-address."+ nameserviceId +".nn1", getProperty("nn1.rpc-address"));
conf.set("dfs.namenode.rpc-address."+ nameserviceId +".nn2", getProperty("nn2.rpc-address"));
conf.set("dfs.namenode.http-address."+ nameserviceId +".nn1", getProperty("nn1.http-address"));
conf.set("dfs.namenode.http-address."+ nameserviceId +".nn2", getProperty("nn2.http-address"));
conf.set("dfs.client.failover.proxy.provider."+nameserviceId,"org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider");

.

Reference: https://community.hortonworks.com/questions/136278/ambari-namenode-ha-connect.html

Re: Question on Namenode services failover

Super Mentor

Here:

dfs.client.failover.proxy.provider.[nameservice ID]- the Java class that HDFS clients use to contact the Active NameNode

Configure the name of the Java class which will be used by the DFS Client to determine which NameNode is the current Active, and therefore which NameNode is currently serving client requests.

https://hadoop.apache.org/docs/r2.7.1/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.ht...

Don't have an account?
Coming from Hortonworks? Activate your account here