HDFS per-user Metrics aren't emitted by default. Kindly exercise caution before enabling them and make sure to refer to the details of client and service port numbers.
To be able to use the HDFS - Users dashboard in your Grafana instance as well as to view metrics for HDFS per user, you will need to add these custom properties to your configuration.
Presumption for this guide:This is a HA environment with dfs.internal.nameservices=nnha and dfs.ha.namenodes.nnha=nn1,nn2 in Ambari, HDFS > Configs > Advanced > Custom hdfs-site1. In Ambari, HDFS > Configs > Advanced > Custom hdfs-site - Add the following properties.
If you have already enabled Service RPC port, then you can avoid adding the first two lines about servicerpc-address.
Replace 8020 with your Namenode RPC port if it is different.
DO NOT replace it with Service RPC Port or DataNode Lifeline Port
2. After this change you may see issues like both namenodes as Active or both as Standby in Ambari.To avoid this issue:
a. Stop the ZKFC on both NameNodes b. Run the following command from one of the Namenode host as hdfs user
su - hdfs
hdfs zkfc -formatZK
c. Restart all ZKFC
3: Restart HDFS & you should see the metrics being emitted.4: After a few minutes, you should also be able to use the HDFS - Users Dashboard in Grafana.
Things to ensure:
Example: dfs.namenode.servicerpc-address.nnha.nn1=<namenodehost1>:8050 dfs.namenode.servicerpc-address.nnha.nn2=<namenodehost2>:8050* For more than 2 namenodes in your HA environment, please add one additional line for each additional namenode: dfs.namenode.servicerpc-address.<dfs.internal.nameservices>.nnX=<namenodehostX>:8021
Adapted from this wiki which describes how to enable per user HDFS metrics for a non-HA environment.
Note : This article has been validated against Ambari-2.5.2 and HDP-2.6.2
It will not work in older versions of Ambari due to this BUG https://issues.apache.org/jira/browse/AMBARI-21640