Created 11-11-2017 01:13 PM
Hello in ambari I have already set recovery enabled = true and from ambari UI Service auto start option to enabled to all services.
When I stop and start ambari server it works fine. But when I power off virtual box and again start services does not get started.
What is the solution to start services after power off option from Virtual box ? What could be the possible reason for this ?
Created 11-11-2017 02:06 PM
Hi Kuldeep Please suggest an Answer.
Created 11-11-2017 02:33 PM
Which version of ambari are you using?
Ambari 2.4.0 introduced dynamic auto-recovery, which allows auto-start properties to be configured without needing an ambari-agent / ambari-server restart. Currently, the simplest way to manage the auto-recovery features within Ambari is via the REST API.
Example: For HBase Region Servers (Using API calls)
# curl -u admin:<password> -H "X-Requested-By: ambari" -X PUT 'http://localhost:8080/api/v1/clusters/<cluster_name>/components?ServiceComponentInfo/component_name.in(HBASE_REGIONSERVER)' -d '{"ServiceComponentInfo" : {"recovery_enabled":"true"}}'
.
Reference: (Using Ambari UI "Enable Service Auto-Start")
.
Created 11-11-2017 02:53 PM
Another Option will be to add the following "curl" command in some checker script which will be invoked when the ambari server is Up and running (listening to port 8080)to make sure that as soon as the Ambari Server comes up it tries to start all the Stopped Services. (if the services are already started then it will not restart it).
# curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"Sandbox"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' "http://localhost:8080/api/v1/clusters/Sandbox/services?"
.
Please replace the "localhost" with Ambari Server Hostname
And "Sandbox" with your Cluster name in the above API call.
Created 11-11-2017 03:26 PM
Created 11-13-2017 08:16 AM
Hi Jay, I am using ambari Version2.5.1.0.
The above curl command works but as usual it takes lot of time to get started. It takes around 18 mins to start all services. Is there any way to start all services as Hortonworks does ?
Created 11-13-2017 08:27 AM
Ambari uses the same approach to start all services. It depends on the available resources (like free RAM, N/W, IO ...etc) factors that the service startup might take some time.
You can compare the time by doing the same "Start All Services" from Ambari UI as well and you will see that it also makes the same call to start the services.
.
Created 11-13-2017 08:30 AM
For some other script based approach you can refer to the following thread which people used to refer for old version of ambari. With latest Ambari the dynamic "recovery_enabled" is the best.
.