Community Articles

Find and share helpful community-sourced technical articles.
Celebrating as our community reaches 100,000 members! Thank you!
Labels (1)
Expert Contributor

We have seem many incidents of overloaded HDFS namenode due to 1) misconfigurations or 2) “bad” MR jobs or Hive queries that create large amount of RPC requests in a short period of time. There are quite a few features that have been introduced in HDP 2.3/2.4 to protect HDFS namenode. This article summarize the deployment steps of these features with an incomplete list of known issues and possible solutions for them.

  1. Enable Async Audit Logging
  2. Dedicated Service RPC Port
  3. Dedicated Lifeline RPC Port for HA
  4. Enable FairCallQueue on Client RPC Port
  5. Enable RPC Client Backoff on Client RPC port
  6. Enable RPC Caller Context to track the “bad” jobs
  7. Enable Response time based backoff with DecayedRpcScheduler
  8. Check JMX for namenode client RPC call queue length and average queue time
  9. Check JMX for namenode DecayRpcScheduler when FCQ is enabled
  10. NNtop (HDFS-6982)

1. Enable Async Audit Logging

Enable async audit logging by setting "dfs.namenode.audit.log.async" to true in hdfs-site.xml. This can minimize the impact of audit log I/Os on namenode performance.


2. Dedicated Service RPC Port

Configuring a separate service RPC port can improve the responsiveness of the NameNode by allowing DataNode and client requests to be processed via separate RPC queues. Datanode and all other services should be connected to the new service RPC address and clients connect to the well known addresses specified by dfs.namenode.rpc-address.

Adding a service RPC port to an HA cluster with automatic failover via ZKFCs (with/wo Kerberos) requires some additional steps as follows:

  1. Add the following settings to hdfs-site.xml.

2. If the cluster is not Kerberos enabled, skip this step.

If the cluster is kerberos enabled, create two new hdfs_jass.conf files for nn1 and nn2 and copy them to /etc/hadoop/conf/hdfs_jaas.conf, respectively


Client { required useKeyTab=true storeKey=true useTicketCache=false keyTab="/etc/security/keytabs/nn.service.keytab" principal="nn/";};


Client { required useKeyTab=true storeKey=true useTicketCache=false keyTab="/etc/security/keytabs/nn.service.keytab" principal="nn/";};

Add the following to

export HADOOP_NAMENODE_OPTS="-Dzookeeper.sasl.client=true -Dzookeeper.sasl.client.username=zookeeper -Dzookeeper.sasl.clientconfig=Client ${HADOOP_NAMENODE_OPTS}"

3. Restart NameNodes

4. Restart DataNodes to connect to the new NameNode service RPC port instead of the NameNode client RPC port .

5. Stop the ZKFC processes on both NameNodes

6. Run the following command to reset the ZKFC state in ZooKeeper

hdfs zkfc -formatZK

Known issues:

1. Without step 6 you will see the following exception after ZKFC restart.

java.lang.RuntimeException:Mismatched address stored in ZK forNameNode

2. Without step 2 in a Kerberos enabled HA cluster, you will see the following exception when running step 6.

16/03/23 03:30:53 INFO ha.ActiveStandbyElector: Recursively deleting /hadoop-ha/hdp64ha from ZK...16/03/23 03:30:53 ERROR ha.ZKFailoverController: Unable to clear zk parent Couldn't clear parent znode /hadoop-ha/hdp64haat org.apache.hadoop.ha.ActiveStandbyElector.clearParentZNode( org.apache.hadoop.ha.ZKFailoverController.formatZK( org.apache.hadoop.ha.ZKFailoverController.doRun( org.apache.hadoop.ha.ZKFailoverController.access$000( org.apache.hadoop.ha.ZKFailoverController$ org.apache.hadoop.ha.ZKFailoverController$ Method)at

Caused by: org.apache.zookeeper.KeeperException$NotEmptyException: KeeperErrorCode = Directory not empty for /hadoop-ha/hdp64haat org.apache.zookeeper.KeeperException.create( org.apache.zookeeper.KeeperException.create( org.apache.zookeeper.ZooKeeper.delete( org.apache.zookeeper.ZKUtil.deleteRecursive( org.apache.hadoop.ha.ActiveStandbyElector$ org.apache.hadoop.ha.ActiveStandbyElector$ org.apache.hadoop.ha.ActiveStandbyElector.zkDoWithRetries( org.apache.hadoop.ha.ActiveStandbyElector.clearParentZNode(
... 11 more

3. Dedicated Lifeline RPC Port for HA

HDFS-9311 allows using a separate RPC address to isolate health checks and liveness from client RPC port which could be exhausted due to “bad” jobs. Here is an example to configure this feature in a HA cluster.


webinar banner
Version history
Last update:
‎07-06-2016 08:40 PM
Updated by:
meetups banner