[ClusterLabs] Multiple apache services running
Ken Gaillot
kgaillot at redhat.com
Wed Jul 29 14:22:33 UTC 2015
On 07/29/2015 09:03 AM, Vijay Partha wrote:
> Thanks a lot Ken. for the second case whatever you said , is it possible to
> control even for multiple instances of apache? like i have node 1 running 2
> instances of apache and another node running 1 instance in apache. If my
> apache server goes down will all these instances be restarted?
It depends on how you have those instances linked together.
If they're independent -- one node runs www.A.com and another node runs
api.A.com -- then there's no coordination necessary. Each can be
monitored, stopped and started independently of the other.
If your goal is to do active-passive failover (if the node serving
www.A.com goes down, apache is started on another node), then pacemaker
will handle that automatically.
If your goal is to do active-active load-balancing (every node can serve
requests to www.A.com simultaneously), that's a more complicated
configuration, but pacemaker can do it.
In any of the cases, it's generally not necessary to restart apache on
all nodes. If it's not working on one node, it can be restarted there.
You can manually disable and reenable the service if you want to force a
restart everywhere.
> On Wed, Jul 29, 2015 at 7:26 PM, Ken Gaillot <kgaillot at redhat.com> wrote:
>
>> On 07/29/2015 08:05 AM, Vijay Partha wrote:
>>> Hi.
>>>
>>> Victor, Whatever you said i had tried and got it working. Thank you.
>>>
>>> Could you guys answer the following questions please?
>>>
>>> 1.) I have 2 apache services running on the same node. If the services go
>>> down can pacemaker restart it?
>>
>> Yes, that's what pacemaker is for :)
>>
>> If by two services you mean two server instances of apache, then you
>> would configure two apache resources in pacemaker. If you mean two web
>> apps running in one apache server, you'd configure one apache resource
>> in pacemaker.
>>
>> You would also need a monitor operation, which tells pacemaker to
>> periodically check the health of the service.
>>
>> The migration-threshold and on-fail options determine what the cluster
>> does on failure. See the documentation for possible values, but the
>> default behavior is to try to restart the service on the same node.
>>
>> The documentation for all the options is at
>>
>> http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-single/Pacemaker_Explained/index.html
>>
>>> 2.) I have 2 apache services running on different nodes. Can i control
>> both
>>> the resources from a single node by making use of pacemaker?
>>
>> The various cluster tools work from any node, to affect any or all
>> nodes. Most commonly you'd use one of the high-level cluster shells
>> (crmsh or pcs). They have commands to enable/disable a resource, move a
>> resource to a different node, put a node in standby mode, etc.
More information about the Users
mailing list