[ClusterLabs] master/slave resource agent without demote

Ken Gaillot kgaillot at redhat.com
Mon Nov 30 17:47:31 EST 2015


On 11/25/2015 10:57 PM, Waldemar Brodkorb wrote:
> Hi,
> Andrei Borzenkov wrote,
> 
>> On Tue, Nov 24, 2015 at 5:19 PM, Waldemar Brodkorb
>> <mail at waldemar-brodkorb.de> wrote:
>>> Hi,
>>>
>>> we are using a derivate of the Tomcat OCF script.
>>> Our web application needs to be promoted (via a wget call).
>>> But our application is not able to demote in a clean way, so
>>> we need to stop and then start the tomcat applicationserver
>>> to get into slave mode.
>>>
>>> What is the best way to handle this?
>>>
>>
>> Not sure I understand the question. If your application has to be
>> restarted on demote, you restart it on demote in your RA. Or do I
>> misunderstand your question?
> 
> Yes, at the moment we stop it first with the stop function and
> then execute the RA with the start parameter in the background
> returning OCF_SUCCESS. Then there are some
> stamp files containing the current time in unix seconds to prevent
> another start while asynchonely demoting.
>  
> I am experimenting right now with just using the stop function.
> It works at least for three failover scenarios:
> - poweroff the master
> - reboot the master
> - crm node standby / crm node online the master

I'd recommend that the agent do a synchronous stop then start for
demote. Once demote returns 0 (success), the service should be in a
state such that any subsequent monitor will also return 0.

If you implemented stop only, then the next monitor should report 7 (not
running), which would be considered a failure. Similarly, if start is
async, the next monitor might run before the start is done.

> Next I need to test migrate, I think the reason for the complex
> demote fake was a problem with migrate.
> 
> best regards





More information about the Users mailing list