Support Questions

Find answers, ask questions, and share your expertise

Auto restart ambari 2.2x

avatar
Contributor

I have a VM with docker containers running HDP. If I shutdown the VM and restart - the containers come up along with ambar-server and agent, but I have to manally start each component. Is there an easy way to make all components start up in order?

1 ACCEPTED SOLUTION
6 REPLIES 6

avatar
Contributor

Thanks for the quick response. How does the sandbox actually start all the services? Is there an easier way vs having to keep track of all the services added/removed etc. ? I read somewhere there is some option in ambari.properties (but i can't seem to find anything) ?

avatar
Master Guru

yes you can do it very ambari.properties. for full info go here:

https://cwiki.apache.org/confluence/display/AMBARI/Recovery%3A+auto+start+components#Recovery:autost...

IE

How auto start works in Ambari versions 2.3.x/2.2.x

When an ambari agent starts, it bootstraps with the ambari server via registration. The server sends information to the agent about the components that have been enabled for auto start along with the other auto start properties in ambari.properties. The agent compares the current state of these components against the desired state, to determine if these components are to be installed, started, restarted or stopped.

Ambari.properties

To enable components for auto start, specify them using recover.enabled_components=A,B,C

# Enable Metrics Collector auto-restart

recovery.type=AUTO_START

recovery.enabled_components=METRICS_COLLECTOR

recovery.lifetime_max_count=1024

Here’s a sample snippet of the auto start configuration that is sent to the agent by the server during agent registration:

"recoveryConfig": {

"type" : "AUTO_START",

"maxCount" : 10,

"windowInMinutes" : 60,

"retryGap" : 0,

"enabledComponents" : "a,b",

“disabledComponents”: “c,d”

}

For example, if the current state of METRICS_COLLECTOR component on a host is INSTALLED but it is enabled for auto start, the desired state is STARTED. The recovery manager generates a start command for METRICS_COLLECTOR which is executed by the controller.

More on link provided

avatar
Contributor

Great. I'll try that out here shortly and report back.

avatar
Contributor

Is that on all the agents or on ambari server machine? I'm assuming _CLIENT components aren't needed. Thanks.

avatar
Contributor

Nevermind...its only on server 🙂 it does seem to work, but doesn't show it in "op"