[ClusterLabs] Apache graceful restart not supported by heartbeat apache control script

Andrei Borzenkov arvidjaar at gmail.com
Mon Mar 25 15:04:49 EDT 2019

25.03.2019 20:42, Cole Miller пишет:
> Hi users at clusterlabs.org,
> My current project at work is a two node cluster running apache and
> virtual IPs on CentOS 7. I found in my testing that apache when run
> by corosync does not have a reload or graceful restart. Before the
> cluster, when apache was a single instance, I previously used
> graceful restart to be able to add configurations with out affecting
> current users of the system.
> Initially, I tried adding the capability myself as a resource action
> in the pcs configuration, I was able to add the action, but it would
> have no effect when run. Digging deeper, I eventually found the
> apache control script at /usr/lib/ocf/resource.d/heartbeat/apache and
> was able to see that there are no commands available for a graceful
> restart, only graceful stop.
> Currently, I have found two ways of getting around this limitation.
> The first is “/bin/kill -USR1 `cat /var/run/httpd.pid`", and the
> second is "/bin/test -f /var/run/httpd.pid && /usr/sbin/httpd -f
> /etc/httpd/conf/httpd.conf -c "PidFile /var/run/httpd.pid" -k
> graceful”. Both seem to work with out adversely affecting corosync.
> My primary question is; what is the reason that graceful restart is
> not supported by the heartbeat apache control script?

As far as I know pacemaker does not support "graceful restart" with
semantic you want at all. Pacemaker supports "reload" action if some
parameters to *resource* change. But changing of apache configuration is
not visible to pacemaker at all.

> It seems like a
> pretty common usage of apache, so it seems a strange omission from
> the script. I am concerned that I’m trying to work against the grain
> since it is absent from the script.
> My second question is; are the two work arounds presented above safe
> for use with corosync/heartbeat/pcs? Is one preferable to the other?
> If neither are safe, how would you recommend being able to update
> apache configurations with no downtime?

As long as graceful restart of apache does not cause client connection
failure I do not see why you cannot use it. Whichever works for you.
Apache monitor action tries to connect to httpd and request test page.
If reload takes too much time I presume monitor can timeout in which
case you may need to increase waiting time.

> I am new to this list and could not find a way to search the
> archives, so if this question has already been answered, could you
> point me to the search area and to the answer as well?
> Thank you in advance for your advice and recommendations. -Cole
> _______________________________________________ Manage your
> subscription: https://lists.clusterlabs.org/mailman/listinfo/users
> ClusterLabs home: https://www.clusterlabs.org/

More information about the Users mailing list