Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

ambari cluster + auto process to start all services that are down

Solved Go to solution

ambari cluster + auto process to start all services that are down

after we install new ambari cluster some of the ambari services are down

I know how to start the service by API

but in case there more services that are down or all them , then need to start according to start priority

is it possible to start all services that are down by API and according to priority , without manual startup?

Michael-Bronson
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: ambari cluster + auto process to start all services that are down

Super Mentor

@uri ben-ari

Following API call will check the services that are down and will start them in the correct order if any of the service is down.

# curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"plain_ambari"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/services?


Please replace the following:

- "amb25101.example.com" with your Ambari Server Hostname

- "plain_ambari" with your ambari cluster name

- "8080" with the port of your ambari server.

.

Example Output:

# curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"plain_ambari"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/services?
{
  "href" : "http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/requests/134",
  "Requests" : {
    "id" : 134,
    "status" : "Accepted"
  }
}

.

Later the progress can be tracked by looking at the API response (requestID)

http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/requests/134

.

View solution in original post

7 REPLIES 7
Highlighted

Re: ambari cluster + auto process to start all services that are down

Super Mentor

@uri ben-ari

Following API call will check the services that are down and will start them in the correct order if any of the service is down.

# curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"plain_ambari"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/services?


Please replace the following:

- "amb25101.example.com" with your Ambari Server Hostname

- "plain_ambari" with your ambari cluster name

- "8080" with the port of your ambari server.

.

Example Output:

# curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"plain_ambari"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/services?
{
  "href" : "http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/requests/134",
  "Requests" : {
    "id" : 134,
    "status" : "Accepted"
  }
}

.

Later the progress can be tracked by looking at the API response (requestID)

http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/requests/134

.

View solution in original post

Highlighted

Re: ambari cluster + auto process to start all services that are down

this is great answer , I will test the syntax above , thank you so much for your fast response and your professional knowledge ,

Michael-Bronson
Highlighted

Re: ambari cluster + auto process to start all services that are down

can you please defined all the syntax with -

  1. http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/requests/134
Michael-Bronson
Highlighted

Re: ambari cluster + auto process to start all services that are down

do you mean to see the progress like this - curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"plain_ambari"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' http://198.23.45.23:8080/api/v1/clusters/HDP01/requests/134

Michael-Bronson
Highlighted

Re: ambari cluster + auto process to start all services that are down

Super Mentor

@uri ben-ari

curl -u admin:admin -H "X-Requested-By: ambari" -X GET  http://198.23.45.23:8080/api/v1/clusters/HDP01/requests/134

.

Here 134 will be the request ID that you got from the previous command output.

The output contain the request status as following: (Or IN_PROGRESS is the start is going on)

"request_status" : "COMPLETED",

.

Highlighted

Re: ambari cluster + auto process to start all services that are down

Mentor

@uri ben-ari

Is the request ID correct?

Highlighted

Re: ambari cluster + auto process to start all services that are down

now I see the req ID , all is right now

Michael-Bronson
Don't have an account?
Coming from Hortonworks? Activate your account here