Re: [ClusterLabs] master/slave resource agent without demote

2015-11-30 Thread Ken Gaillot
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
>>  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


___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org


Re: [ClusterLabs] master/slave resource agent without demote

2015-11-24 Thread Andrei Borzenkov
On Tue, Nov 24, 2015 at 5:19 PM, Waldemar Brodkorb
 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?

___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org


[ClusterLabs] master/slave resource agent without demote

2015-11-24 Thread Waldemar Brodkorb
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?

Have anyone an idea?

best regards
 Waldemar


___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org