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".