Support Questions

Find answers, ask questions, and share your expertise

API + restart the services that restart is required

avatar

after adding new parameter and value to the ambari cluster , we need to restart the service to take affect

from ambari GUI restart the service is required , and we can see that because restart button is colored with orange

so my question is

we need API command that restart only the services that restart is required?

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@uri ben-ari

Please pardon me 😞

The URL should end with "requests" instead of "request"

.

Example:

 #  curl  -u admin:admin -H "X-Requested-By: ambari" -X POST  -d '{"RequestInfo":{"command":"RESTART","context":"Restart all required services","operation_level":"host_component"},"Requests/resource_filters":[{"hosts_predicate":"HostRoles/stale_configs=true"}]}' http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/requests

{
  "href" : "http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/requests/132",
  "Requests" : {
    "id" : 132,
    "status" : "Accepted"
  }
}

.

View solution in original post

14 REPLIES 14

avatar

I test it again , hostname for sure is ok and the cluster name is correct , what chuld be the problem

Michael-Bronson

avatar
Master Mentor

@uri ben-ari

Please pardon me 😞

The URL should end with "requests" instead of "request"

.

Example:

 #  curl  -u admin:admin -H "X-Requested-By: ambari" -X POST  -d '{"RequestInfo":{"command":"RESTART","context":"Restart all required services","operation_level":"host_component"},"Requests/resource_filters":[{"hosts_predicate":"HostRoles/stale_configs=true"}]}' http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/requests

{
  "href" : "http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/requests/132",
  "Requests" : {
    "id" : 132,
    "status" : "Accepted"
  }
}

.

avatar

now command its works , but in the ambari cluster the service hive and the service spark2 still have the button restart in orange ( so seems command works on linux ) but not refreshed the service , the target of my quastion was to restart/refreshed all services that need to be restart

Michael-Bronson

avatar
Master Mentor

@uri ben-ari

Please check the progress of the request ID ... to see if it is completed or stuck:?

Example:

curl  -u admin:admin -H "X-Requested-By: ambari" -X GET http://amb25101.example.com:8080/api/v1/clusters/plain_ambari/requests/132

.

avatar

every thing is ok now thx

Michael-Bronson