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 services not able to start after power off from virtual box. ? However it works in Ambari server start and stop ?

Ambari services not able to start after power off from virtual box. ? However it works in Ambari server start and stop ?

New Contributor

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 ?

7 REPLIES 7
Highlighted

Re: Ambari services not able to start after power off from virtual box. ? However it works in Ambari server start and stop ?

New Contributor
@Kuldeep Kulkarni

Hi Kuldeep Please suggest an Answer.

Re: Ambari services not able to start after power off from virtual box. ? However it works in Ambari server start and stop ?

Super Mentor

@Swapnil Patil

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")

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.2.0/bk_ambari-operations/content/enable_service...

https://community.hortonworks.com/articles/71748/how-do-i-enable-automatic-restart-recovery-of-serv....

.

Re: Ambari services not able to start after power off from virtual box. ? However it works in Ambari server start and stop ?

Super Mentor

@Swapnil Patil

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.

Re: Ambari services not able to start after power off from virtual box. ? However it works in Ambari server start and stop ?

Super Mentor

Re: Ambari services not able to start after power off from virtual box. ? However it works in Ambari server start and stop ?

New Contributor

@Jay Kumar SenSharma

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 ?

Re: Ambari services not able to start after power off from virtual box. ? However it works in Ambari server start and stop ?

Super Mentor

@Swapnil Patil

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.

.


Re: Ambari services not able to start after power off from virtual box. ? However it works in Ambari server start and stop ?

Super Mentor

@Swapnil Patil

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.

https://community.hortonworks.com/questions/34678/how-to-get-automatically-services-started-when-we....

.