Created 06-14-2016 02:04 PM
I am automating the process of recovery of a failed host in a cluster(using python), and I need to add a host to the cluster then I will install components on that.
Ambari has API to add a host e.g.
requests.post(" http://<ambari-host-IP>:<port>/api/v1/clusters/<CLUSTERNAME>/hosts/<HOSTNAME>", auth=self.auth, headers=self.headers, proxies=self.proxyDict)
but it dosent takes ssh key and password.
I dont want to explicitly install abmari agent using YUM(and changing agent.ini config file)because server version and agent version may not match.
Do we have a way to add ssh key and ssh password to above post command.
Or, is there any other automated way to add and register a host to an existing cluster through a python prograam ?
Created 06-15-2016 05:53 AM
See if this is what you are looking for.
https://cwiki.apache.org/confluence/display/AMBARI/Installing+ambari-agent+on+target+hosts
Created 06-14-2016 02:19 PM
Using ambari api/ post command you will not able to install/register new host to the cluster.
To achieve this you need to write custom python script and get the steps done as mentioned in - https://cwiki.apache.org/confluence/display/AMBARI/Add+a+host+and+deploy+components+using+APIs
Created 06-14-2016 06:42 PM
@Mukesh Burman You can also check Ambari Blueprints for automation
Created 06-15-2016 05:13 AM
@Sagar Shimpi Many thanks for your reply, but the page u refereed, starts with "Ensure the host is registered properly"
and, I need a way to register a host with ssh key and password, so that ambari server can install ambari agent on new host.
without ssh key and password, ambari server fails to to so, In ambari UI there is an option to put a ssh key and password but how to do that using curl command ?
Created 06-15-2016 05:53 AM
See if this is what you are looking for.
https://cwiki.apache.org/confluence/display/AMBARI/Installing+ambari-agent+on+target+hosts
Created 06-15-2016 12:25 PM
@Rahul Pathak I already tried this, but after submitting bootstrap request, it never returns a failure or success response, I always get a running status, although, I carried on further and saw that ambari agent was installed successfully(despite of not getting a failure/success response). And like this my job is done. 🙂
Thanks man
Created 06-15-2016 12:30 PM
I guess you can accept my answer. 🙂
Created 06-15-2016 12:35 PM
Oops! my bad...
Did it 🙂