How to find a Hadoop or Ambari cluster name from the command line
search cancel

How to find a Hadoop or Ambari cluster name from the command line

book

Article ID: 294676

calendar_today

Updated On:

Products

Services Suite

Issue/Introduction

This article describes how to find the Ambari cluster name from the CLI.

Environment


Cause

During troubleshooting and more specifically, while using the Ambari API, it might be necessary know the Ambari cluster name. This article describes a simple way to find the cluster name through the CLI.

Resolution

Follow the instructions below to find the Ambari cluster name from the CLI:

1. Log into the Ambari node as the user root.

2. Run the command curl --user username:password http://localhost:8080/api/v1/clusters/.

[root@amb171hawq ~]# curl --user admin:admin http://localhost:8080/api/v1/clusters/
{
 "href" : "http://localhost:8080/api/v1/clusters/",
 "items" : [
 {
 "href" : "http://localhost:8080/api/v1/clusters/amb171hawq",
 "Clusters" : {
 "cluster_name" : "amb171hawq",
 "version" : "PHD-3.0"
 }
 }
 ]
}
[root@amb171hawq ~]#

3. From the above output, we can see that the cluster name is "amb171hawq".