[ClusterLabs] Apache doesn't start under corosync with systemd
Ken Gaillot
kgaillot at redhat.com
Mon Oct 7 11:27:21 EDT 2019
On Fri, 2019-10-04 at 14:10 +0000, Reynolds, John F - San Mateo, CA -
Contractor wrote:
> Good morning.
>
> I’ve just upgraded a two-node active-passive cluster from SLES11 to
> SLES12. This means that I’ve gone from /etc/init.d scripts to
> systemd services.
>
> On the SLES11 server, this worked:
>
> <primitive id="ncoa_apache" class="ocf" provider="heartbeat"
> type="apache">
> <instance_attributes id="ncoa_apache-instance_attributes">
> <nvpair name="configfile" value="/etc/apache2/httpd.conf"
> id="ncoa_apache-instance_attributes-configfile"/>
> </instance_attributes>
> <operations>
> <op name="monitor" interval="40s" timeout="60"
> id="ncoa_apache-monitor-40s"/>
> </operations>
> </primitive>
>
> I had to tweak /etc/init.d/apache2 to make sure it only started on
> the active node, but that’s OK.
If pacemaker is managing a resource, the service should not be enabled
to start on boot (regardless of init or systemd). Pacemaker will start
and stop the service as needed according to the cluster configuration.
Additionally, your pacemaker configuration is using the apache OCF
script, so the cluster won't use /etc/init.d/apache2 at all (it invokes
the httpd binary directly).
Keep in mind that the httpd monitor action requires the status module
to be enabled -- I assume that's already in place.
>
> On the SLES12 server, the resource is the same:
>
> <primitive id="ncoa_apache" class="ocf" provider="heartbeat"
> type="apache">
> <instance_attributes id="ncoa_apache-instance_attributes">
> <nvpair name="configfile" value="/etc/apache2/httpd.conf"
> id="ncoa_apache-instance_attributes-configfile"/>
> </instance_attributes>
> <operations>
> <op name="monitor" interval="40s" timeout="60s"
> id="ncoa_apache-monitor-40s"/>
> </operations>
> </primitive>
>
> and the cluster believes the resource is started:
>
>
> eagnmnmep19c1:/var/lib/pacemaker/cib # crm status
> Stack: corosync
> Current DC: eagnmnmep19c0 (version 1.1.16-4.8-77ea74d) - partition
> with quorum
> Last updated: Fri Oct 4 09:02:52 2019
> Last change: Thu Oct 3 10:55:03 2019 by root via crm_resource on
> eagnmnmep19c0
>
> 2 nodes configured
> 16 resources configured
>
> Online: [ eagnmnmep19c0 eagnmnmep19c1 ]
>
> Full list of resources:
>
> Resource Group: grp_ncoa
> (edited out for brevity)
> ncoa_a05shared (ocf::heartbeat:Filesystem): Started
> eagnmnmep19c1
> IP_56.201.217.146 (ocf::heartbeat:IPaddr2): Started
> eagnmnmep19c1
> ncoa_apache (ocf::heartbeat:apache): Started
> eagnmnmep19c1
>
> eagnmnmep19c1:/var/lib/pacemaker/cib #
>
>
> But the httpd daemons aren’t started. I can start them by hand, but
> that’s not what I need.
>
> I have gone through the ClusterLabs and SLES docs for setting up
> apache resources, and through this list’s archive; haven’t found my
> answer. I’m missing something in corosync, apache, or systemd.
> Please advise.
>
>
> John Reynolds, Contractor
> San Mateo Unix
>
> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
>
> ClusterLabs home: https://www.clusterlabs.org/
--
Ken Gaillot <kgaillot at redhat.com>
More information about the Users
mailing list