Support Questions
Find answers, ask questions, and share your expertise

Adding new node in Ambari cluster created using ambari UI using blueprint

Adding new node in Ambari cluster created using ambari UI using blueprint


I am trying to add one node to my ambari cluster using blue print API which is created using ambari UI. I created blue print and try to add the node to the host group using ambari blue print REST API as below.

curl -i -H "X-Requested-By: ambari" -u admin:pswd -X POST -d @new-host.json <serverurl>:8080/api/v1/clusters/hdpCluster/hosts/<host-id>

I get the below error for this curl request.

  "status" : 400,
  "message" : "Topology validation failed: org.apache.ambari.server.topology.InvalidTopologyException: Unable to retrieve cluster topology for cluster. This is most likely a result of trying to scale a cluster via the API which was created using the Ambari UI. At this time only clusters created via the API using a blueprint can be scaled with this API.  If the cluster was originally created via the API as described above, please file a Jira for this matter."

Is it not possible to add node to cluster created using ambari UI ? Is there any other way for the same ?


Re: Adding new node in Ambari cluster created using ambari UI using blueprint


@Irshad Muhammed

Yes, there is the manual registration, this is convenient when you have few hosts to add and you will have to manually add the HDP components

# yum install -y ambari-agent

Then you will have to edit the ambari-agent.ini usually in /etc/ambari-agent/conf/ assuming you are on RH or Centos, the first entry replace the YOUR_AMBARI_HOST with your FQDN of the Ambari server


Start the ambari agent

#ambari-agent start

Make sure the agents all start successfully do this on all the hosts you intend to add to the cluster, then on the Ambari UI when running the add host step choose the manual registration, add your new hostname and proceed all should succeed.

Using API

Ambari Agent can be installed on a number of target hosts via the Ambari REST API if the hosts have been set up for passwordless SSH (as root or a sudo account) with a common SSH key.

See below for an example ("user" is the SSH user account).

curl -i -uadmin:admin -H 'X-Requested-By: ambari' -H 'Content-Type: application/json' -X POST -d'{
"verbose":true, "sshKey":"-----BEGIN RSA PRIVATE KEY-----\nPRIVATE-KEY-CONTENT-HERE\n----END RSA PRIVATE KEY-----\n",
"" ], 
"user":"root" }' http://localhost:8080/api/v1/bootstrap

The bootstrap process itself happens asynchronously.
To check on the bootstrap process, make a GET call against /api/v1/bootstrap/<requestId> as shown below:

curl -i -uadmin:admin http://localhost:8080/api/v1/bootstrap/1

Hope that helps