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

Error while installing component on a host via Ambari REST API

Solved Go to solution

Re: Error while installing component on a host via Ambari REST API

Contributor

Did adding smokeuser work, @wgonzalez@hortonworks.com?

Highlighted

Re: Error while installing component on a host via Ambari REST API

Are you getting an error when trying to install a component or service?

$ curl -u admin -i -H "X-Requested-By:ambari"-X PUT -d '{"HostRoles": {"state": "INSTALLED"}}' http://<ambari>:8080/api/v1/clusters/clustername/hosts/node1.hortonworks.com/host_components/ZOOKEEP...

The above API will fail because ZOOKEEPER is not the name of a host component. It should either be ZOOKEEPER_CLIENT or ZOOKEEPEER_SERVER. On the trunk build I get a NoSuchResourceException when using ZOOKEEPER as the component name. With the correct component name, the API succeeded.

The API to install the ZOOKEEPER service was successful:

curl -u admin:admin -i -H "X-Requested-By: ambari"-X PUT -d '{"ServiceInfo": {"state" : "INSTALLED"}}' http://127.0.0.1:8080/api/v1/clusters/Sandbox/services/ZOOKEEPER