[Pacemaker] apache service started with different options on failover
Filip Sakáloš
fsakalos at aariadne.com
Fri Sep 23 10:45:20 UTC 2011
OK, so:
The idea behind the whole thing is that we have two node cluster and want to run apache on both nodes at the same time (one node for web apps and the other one for general websites). However, we also want failover, so that apache would be able to run on one node only. For this purpose, we defined PROD and PUBLIC options using which we want to start apache with different configurations.
The first issue was, that we wanted Pacemaker to somehow handle this using standard OCF script, so that when one node would fail, the other one would restart apache resource with different options. I wasn't very successful in configuring this, so we have solved the problem by writing an LSB script and using daemontools to handle the apache itself and it's options.
The second (and last) issue I had been writing about was, that we needed just to restart apache on the working node during failover, because only restart of the whole service would result in correct options (in the case of failover he should start both with PROD and PUBLIC on the functional node).
Finally, after several trials and errors I have achieved this by cloned apache resource and Orders defined this way:
1. Both DRBD filesystem resources have to be running in order for apache to start.
2. then-action property of the Orders is set to stop - that means, that he will first stop apache and then he will automatically start again, because his target role is Started (at least I think it works so).
Sincerely,
Filip
On 23.9.2011, at 9:05, Nikita Michalko wrote:
> Hi Filip,
>
>
> could you be a little bit more precise and explain, what does it mean:
> "somehow solved the previous issue" ? I'm interesting on it ;-)
>
>
> Am Mittwoch, 21. September 2011 18:50:44 schrieb Filip Sakáloš:
>> Hello,
>>
>> I have somehow solved the previous issue. Anyway, thanks for answers. Now
>> I would have a slightly different question. I need to have two apaches,
>> each running on it's own node. However, when one of the nodes fail, I
>> basically just need the apache resource on the working node to stop and
>> start again (we have our own script that will handle the rest). What would
>> be the best way to do this? I have looked in to the Pacemaker Explained
>> documentation, but didn't find how to do it (sorry if I was just blind -
>> if yes, could you refer me to the specific part of the documentation where
>> it's written about?).
>>
>> On 20.9.2011, at 3:48, Andrew Beekhof wrote:
>>> On Mon, Sep 19, 2011 at 1:29 AM, Filip Sakáloš <fsakalos at aariadne.com>
> wrote:
>>>>> Hello there,
>>>>>
>>>>> I am currently developing a cluster, which main principle is to run
>>>>> some resources on one node and another resources on another node. This
>>>>> is quite simple to configure, but I have encountered a problem with
>>>>> configuring apache resource. I need apache to start on both nodes, but
>>>>> with different options (node1 with -DPROD and node2 with -DPUBLIC).
>>>>> However, when apache (or whole node fails), I need the apache on the
>>>>> working node to restart with both above options (e.g. node1 with -DPROD
>>>>> -DPUBLIC).
>>>>>
>>>>> I have tried clone, but did not get very far. Other option I tried was
>>>>> to create 2 apache services (apache-single & apache-both) in cluster
>>>>> configuration and create an anti-colocation that would cause the
>>>>> resource apache-single to stop when apache-both starts. This somehow
>>>>> doesn't work either.
>>>
>>> It should. What did you configuration look like? What pacemaker version?
>>>
>>>>> Does anyone have a clue or an idea how it could be solved?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Filip
>>>>
>>>> _______________________________________________
>>>> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>>>> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>>>>
>>>> Project Home: http://www.clusterlabs.org
>>>> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>>>> Bugs:
>>>> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemake
>>>> r
>>>
>>> _______________________________________________
>>> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>>> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>>>
>>> Project Home: http://www.clusterlabs.org
>>> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>>> Bugs:
>>> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>>
>
> Best regards
>
> Nikita Michalko
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1762 bytes
Desc: not available
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20110923/31ed376b/attachment-0004.p7s>
More information about the Pacemaker
mailing list