Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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