[Pacemaker] apache on too many nodes?

marvin at nic.fi marvin at nic.fi
Thu Oct 4 20:33:54 EDT 2012


Jake Smith [jsmith at argotec.com] kirjoitti: 
> 
> 
> 
> ----- Original Message -----
> > From: "Andreas Kurz" <andreas at hastexo.com>
> > To: pacemaker at oss.clusterlabs.org
> > Sent: Thursday, October 4, 2012 9:50:52 AM
> > Subject: Re: [Pacemaker] apache on too many nodes?
> > 
> > On 10/03/2012 10:47 PM, Jake Smith wrote:
> > > 
> > > 
> > > 
> > > ----- Original Message -----
> > >> From: marvin at nic.fi
> > >> To: pacemaker at oss.clusterlabs.org
> > >> Sent: Wednesday, October 3, 2012 4:36:10 PM
> > >> Subject: [Pacemaker] apache on too many nodes?
> > >>
> > >> Hello,
> > >>
> > >> I'm currently testing out a 2 node system with the simple goal of
> > >> providing failover so that the services are run on one node at a
> > >> time.
> > >> I have some of the mysql and apache configuration files in the
> > >> drbd
> > >> partition.
> > >>
> > >> Without apache everything works as expected drbd and mysql start
> > >> and
> > >> stop properly on the nodes, but as soon as i try to put apache
> > >> into
> > >> to mix nothing works anymore.
> > >>
> > >> Using the following configuration:
> > >>
> > >> primitive drbd ocf:linbit:drbd params drbd_resource="drbd" op
> > >> start
> > >> interval="0" timeout="240s" op stop interval="0" timeout="100s"
> > >> ms drbd_ms drbd meta master-max="1" master-node-max="1"
> > >> clone-max="2"
> > >> clone-node-max="1" notify="true"
> > >> primitive drbd_fs ocf:heartbeat:Filesystem params
> > >> device="/dev/drbd0"
> > >> directory="/mnt/drbd" fstype="ext3" op start interval="0"
> > >> timeout="60" op stop interval="0" timeout="120"
> > >> primitive service_mysqld lsb:mysql op monitor interval="15s"
> > >> primitive service_apache lsb:apache2 op monitor interval="15s"
> > >> group services_group service_mysqld service_apache
> > >> colocation lamp_services inf: drbd_fs drbd_ms:Master
> > >> services_group
> > > 
> > > Pretty sure your colocation is the problem - services_group should
> > > be first not last...
> > > 
> > > colocation lamp_services inf: services_group drbd_fs drbd_ms:Master
> > 
> > It has to be:
> > 
> > colocation lamp_services inf: drbd_fs services_group drbd_ms:Master
> > 
> 
> Oooh thanks for the correction Andreas - didn't know that the group would be paired with a primitive to create a set!  And I concur - much clearer/easier if you just put the fs in the group.
> 
> Jake
> 
> > ... if you really want to use resource-sets, I'd recommend putting
> > the
> > fs into the services_group on the first position to avoid confusion
> > and use:
> > 
> > colocation lamp_services inf: services_group drbd_ms:Master
> > 
> > You disabled automatic start via init for apache & mysql? You checked
> > the apache LSB script for LSB compliance?

apache doesen't start on startup and the init scripts are LSB compilant.
I think there is something in the way apache starts. I had the apache configuration files in the drbd partition
Which does work if I simply removed apache from the pacemaker configuration and started it manually.
Now i have apache configuration files on both nodes seperately. 
It does take a minute or so to start up with a buch of:

[Fri Oct 05 03:21:14 2012] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze14 with Suhosin-Patch configured -- resuming normal operations
[Fri Oct 05 03:21:14 2012] [notice] caught SIGTERM, shutting down
[Fri Oct 05 03:21:15 2012] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze14 with Suhosin-Patch configured -- resuming normal operations
[Fri Oct 05 03:21:15 2012] [notice] caught SIGTERM, shutting down
 
 
 
Fri Oct 05 03:21:48 2012] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze14 with Suhosin-Patch configured -- resuming normal operations
[Fri Oct 05 03:21:48 2012] [notice] caught SIGTERM, shutting down
[Fri Oct 05 03:21:49 2012] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze14 with Suhosin-Patch configured -- resuming normal operations

in apache error log, but it does eventually work as expected.

I also ended up removing the group as it seemed unneccessary

primitive drbd ocf:linbit:drbd params drbd_resource="drbd" op start interval="0" timeout="240s" op stop interval="0" timeout="100s"
ms drbd_ms drbd meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"
primitive drbd_fs ocf:heartbeat:Filesystem params device="/dev/drbd0" directory="/mnt/drbd" fstype="ext3" op start interval="0" timeout="60" op stop interval="0" timeout="120"
primitive service_mysqld lsb:mysql op monitor interval="15s"
primitive service_apache lsb:apache2 op monitor interval="15s"
colocation lamp_services inf: service_apache app_ip service_mysqld drbd_fs drbd_ms:Master
order lamp_order inf: drbd_ms:promote drbd_fs:start app_ip:start service_mysqld:start service_apache:start

I still don't quite understand why apache is behaving this way.

Many thanks to both of you!

:Mrv


> > 
> > Regards,
> > Andreas
> > 
> > --
> > Need help with Pacemaker?
> > http://www.hastexo.com/now
> > 
> > > 
> > > because you want the services group to run on the same node as the
> > > drbd filesystem which has to run on the same node as the drbd
> > > Master.
> > > 
> > >> order lamp_order inf: drbd_ms:promote drbd_fs:start
> > >> services_group:start
> > >>
> > >> I think it wants to start apache on both nodes for some reason
> > >> (and
> > >> fails ofcourse) and promptly stops everything.
> > >>
> > >> service_apache (lsb:apache2) Started (unmanaged) FAILED[ node1
> > >> node2
> > >> ]
> > >>
> > >> I'm probably doing something stupid here. Using debian squeeze.
> > >>
> > >> :Mrv
> > >>
> > >>
> > >> _______________________________________________
> > >> 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://bugs.clusterlabs.org
> > >>
> > >>
> > > 
> > > _______________________________________________
> > > 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://bugs.clusterlabs.org
> > > 
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > 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://bugs.clusterlabs.org
> > 
> 
> _______________________________________________
> 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://bugs.clusterlabs.org
> 






More information about the Pacemaker mailing list