Created 05-30-2021 04:31 AM
Hi Team,
How to find active name node from cli and also want to know where to check automatic namenode failover triggered in the cluster?
Created 05-30-2021 06:19 AM
Hi,
You can use the below ambari api to get the Active NN:
http://{HOST}:8080/api/v1/clusters/{CLUSTER_NAME}/host_components?HostRoles/component_name=NAMENODE&...
Created 05-30-2021 11:39 PM
Thanks to @vamsi_redd for helping us with Ambari API.
Do you have the same API for Cloudera Manager as well?
Created on 05-31-2021 12:42 AM - edited 05-31-2021 12:42 AM
Hello @khanarshadazmat ,
You may get the role information using CM API for HDFS service.
API:
See the below example for a better understanding:
• When I execute the above API, I would get the below details for HDFS service:
"name" : "HDFS-1-NAMENODE-cb7144bc695976e34cfbaaf26c176d21", "type" : "NAMENODE", "serviceRef" : { "clusterName" : "Cluster 1", "serviceName" : "HDFS-1", "serviceDisplayName" : "HDFS-1", "serviceType" : "HDFS" },
... "roleState" : "STARTED", "healthSummary" : "GOOD", "configStalenessStatus" : "FRESH", "haStatus" : "STANDBY", "maintenanceMode" : false, "commissionState" : "COMMISSIONED", "roleConfigGroupRef" : { "roleConfigGroupName" : "HDFS-1-NAMENODE-BASE" },
• and, for the second namenode, I'll get something as below:
"name" : "HDFS-1-NAMENODE-b1d777dd6714507397225b07ea9057ce", "type" : "NAMENODE", "serviceRef" : { "clusterName" : "Cluster 1", "serviceName" : "HDFS-1", "serviceDisplayName" : "HDFS-1", "serviceType" : "HDFS" },
...
"roleState" : "STARTED", "healthSummary" : "GOOD", "configStalenessStatus" : "FRESH", "haStatus" : "ACTIVE", "maintenanceMode" : false, "commissionState" : "COMMISSIONED", "roleConfigGroupRef" : { "roleConfigGroupName" : "HDFS-1-NAMENODE-BASE" }, "entityStatus" : "GOOD_HEALTH"
• In both the above examples, check for the keyword "haStatus". The namenode with haStatus as Active would be your Active Namenode.
Let me know if this helps.
Cheers!
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.