Support Questions

Find answers, ask questions, and share your expertise

AMBARI REST API + how to start only the services/components in the cluster that are down?

avatar

hi all

sometimes after we finished to install ambari cluster by the scripts ( ambari cluster include 3 masters machine and workers machines between 2 to 24 machines )

some components are down ,

so we want to give a second try and to start only the components / services that are down

what is the API for that

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Super Guru

@Michael Bronson,

You can use the below API

curl -u {ambari-username}:{ambari-password} -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"hdp"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' http://{ambari-host}:{ambari-port}/api/v1/clusters/{cluster-name}/services

Replace ambari-username, ambari-password, ambari-host, ambari-port, cluster-name with respective values

Note: Cluster Name should be replaced in 2 places. One in the url {cluster-name} and the other one in the json which I put as hdp


Thanks,

Aditya

View solution in original post

1 REPLY 1

avatar
Super Guru

@Michael Bronson,

You can use the below API

curl -u {ambari-username}:{ambari-password} -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"hdp"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' http://{ambari-host}:{ambari-port}/api/v1/clusters/{cluster-name}/services

Replace ambari-username, ambari-password, ambari-host, ambari-port, cluster-name with respective values

Note: Cluster Name should be replaced in 2 places. One in the url {cluster-name} and the other one in the json which I put as hdp


Thanks,

Aditya