Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

in which cases services auto start will affected

avatar

we enabled the service auto start on all services


and we make a simple test

we stop the service MapReduce2

and we wait some time to see if service will start automatically

but after one hour service still down

dose service auto if relevant in this case ?

69445-capture1.png

69444-capture.png

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@Michael Bronson

If you are stopping a service /component manually (gracefully) then ambari won't try to start it. Auto start of a component is based on its current state and desired state.

Try killing a component abruptly (like kill -9) and then check.

View solution in original post

7 REPLIES 7

avatar
Master Mentor

@Michael Bronson

If you are stopping a service /component manually (gracefully) then ambari won't try to start it. Auto start of a component is based on its current state and desired state.

Try killing a component abruptly (like kill -9) and then check.

avatar

@Jay on which case service auto start will start the services?

Michael-Bronson

avatar
Master Mentor

@Michael Bronson

When the components are stopped normally (gratefully) like from Ambari UI or using API calls (or using direct DB edits) then ambari won't attempt to restart those components/services.

Ambari checks the "Desired State" of the service/component is matching with the current state or not to take the decision on whether to start or not.

So if a component crashes (or killed abruptly like using kill -9) or dues to some other issue then the Ambari Will still think that the component should be running but they are actually not running in that case ambari will attempt to start those component where the state are not matching as expected.

avatar

avatar
Master Mentor

@Michael Bronson

To understand how ambari determines to start a component please keep watching the state change in the following


ambari=> SELECT component_name, current_state FROM hostcomponentstate WHERE component_name='HISTORYSERVER'; ambari=> SELECT component_name, desired_state FROM hostcomponentdesiredstate WHERE component_name='HISTORYSERVER';

.

And in the mean time kill the History Server .

avatar
Explorer

@Jay Kumar SenSharma


As you suggested above can you please help me to know where i can run below query to get the result.


ambari=> SELECT component_name, current_state FROM hostcomponentstate WHERE component_name='HISTORYSERVER'; 
ambari=> SELECT component_name, desired_state FROM hostcomponentdesiredstate WHERE component_name='HISTORYSERVER';

avatar
Explorer

@Jay Kumar SenSharma

I have figured it out. Thank you!!


I also need to know one more thing.

Using the feature Enable Service Auto start is it a safe way to configure it in Ambari in any environment?

Is there any Cons having it enabled?

If we enable auto start, will there be affect on service which will ask for restarting the service?


Thanking in Advance!!!