Created 08-21-2018 05:18 AM
I am trying to install ambari-agent on remote computer which I can ssh without password from server.
I followed this link : http://www-01.ibm.com/support/docview.wss?uid=swg22000281
In bootstrap.py userRunAs=null here, If I install with UI, it is usually root.
In the /var/log/ambari-server/ambari-server.log..
[Thread-12050] BSRunner:258 - Host= <remote host> bs=/usr/lib/python2.6/site-packages/ambari_server/bootstrap.py requestDir=/var/run/ambari-server/bootstrap/32 user=root sshPort=22 keyfile=/var/run/ambari-server/bootstrap/32/sshKey passwordFile null server=<server> version=2.6.1.5 serverPort=8080 userRunAs=null timeout=300
and in /var/log/ambari-server/ambari-audit.log
User(null), RemoteIp(<server>), Operation(User login), Roles( ), Status(Failed), Reason(Authentication required)
User(admin), RemoteIp(<server>), Operation(User login), Roles( Ambari: Ambari Administrator), Status(Success)
Created 08-21-2018 06:14 AM
Hi @Naveen R ,
why dont you try it via UI way.
navigate to Hosts Tab ->Actions -> Add new hosts and ADd via UI.
if you are sure you want to do it via REST API. please try the following. it worked for me.
curl -u admin:admin -H "X-Requested-By:ambari" -i -X POST http://AMBARI_SERVER:8080/api/v1/bootstrap -d '{"verbose":true,"sshKey":"-----BEGIN RSA PRIVATE KEY-----XX PRIVATE KEY-----END RSA PRIVATE KEY-----","hosts":["mycomapny.com"],"user":"root","sshPort":"22","userRunAs":"root"}'
Request you to mark the answer as accepted by clicking on accept button if this helps you :)
Created 08-21-2018 06:14 AM
Hi @Naveen R ,
why dont you try it via UI way.
navigate to Hosts Tab ->Actions -> Add new hosts and ADd via UI.
if you are sure you want to do it via REST API. please try the following. it worked for me.
curl -u admin:admin -H "X-Requested-By:ambari" -i -X POST http://AMBARI_SERVER:8080/api/v1/bootstrap -d '{"verbose":true,"sshKey":"-----BEGIN RSA PRIVATE KEY-----XX PRIVATE KEY-----END RSA PRIVATE KEY-----","hosts":["mycomapny.com"],"user":"root","sshPort":"22","userRunAs":"root"}'
Request you to mark the answer as accepted by clicking on accept button if this helps you :)
Created 08-21-2018 06:24 AM
In the http://<server>:<port>/api/v1/bootstrap/requestId, the status is SUCCESS , but the new host is not shown in http://<server>:<port>/api/v1/clusters/<clusterName>/hosts
Created 08-21-2018 06:37 AM
Hi @Naveen R ,
IMHO you might need to add some service to the newly host added.
can you see by ssh to the host whether the added host has ambari-agent running (ambari-agent status) .
additionally the curl command :
curl -u admin:admin -H "X-Requested-By:ambari" -i -X GET http://AMBARI_SERVER:8080/api/v1/clusters/asnaik/hosts/NEWLY_ADDED_HOST
I would again suggest you add host via Hosts Tab ->Actions -> Add new hosts which is defined and correct way of doing it. or you might need to add service also to the host.
Created 08-29-2018 06:09 AM
I'm getting bad request as response with message "Attempted to add unknown hosts to a cluster. These hosts have not been registered with the server"