Bug 915050
| Summary: | ocf:heartbeat:apache resource not working | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | michal novacek <mnovacek> | ||||||||
| Component: | resource-agents | Assignee: | David Vossel <dvossel> | ||||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Cluster QE <mspqa-list> | ||||||||
| Severity: | urgent | Docs Contact: | |||||||||
| Priority: | urgent | ||||||||||
| Version: | 7.0 | CC: | cluster-maint, djansa, dvossel, fdinitto | ||||||||
| Target Milestone: | rc | Keywords: | TestBlocker | ||||||||
| Target Release: | --- | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | resource-agents-3.9.5-3.el7 | Doc Type: | Bug Fix | ||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | Environment: | ||||||||||
| Last Closed: | 2014-06-13 11:42:03 UTC | Type: | Bug | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Bug Depends On: | 799065 | ||||||||||
| Bug Blocks: | 883874, 1080147 | ||||||||||
| Attachments: |
|
||||||||||
The problem seems to be caused by these two things:
1/ ocf:heartbeat:apache resource incorectly guess pid file of httpd
It previously worked in RHEL6.4 because "PidFile=" has been in httpd.conf by
default and now it's not. It is guessed with the other 'case:' case which is to
take $HA_VARRUN/${httpd_basename}.pid (from
/usr/lib/ocf/lib/heartbeat/ocf-directories) which results incorrectly to
/var/run/httpd.pid where it should be /var/run/http/httpd.pid.
Therefore the script never sees httpd running and it is quite hard to find why
it is not starting.
2/ bz799065 -- adding it as blocker
Created attachment 703926 [details]
workaround for incorrect pid guessing
A patch has been committed for this upstream. https://github.com/davidvossel/resource-agents/commit/2ce0b97d3009b4f0c94d0db83fd68b311de7bc85
I took rhel7.0-20130502, created two-node cluster and installed apache2. I did
not change anything in httpd.conf so there is no PidFile line in there.
# pcs resource show haa-apache
Resource: haa-apache
configfile: /etc/httpd/conf/httpd.conf
op monitor interval=30s
# pcs resource start haa-apache
# pcs status
Cluster name: STSRHTS20736
Last updated: Fri Jun 14 16:26:34 2013
Last change: Fri Jun 14 16:25:39 2013 via cibadmin on virt-001.cluster-qe.lab.eng.brq.redhat.com
Stack: corosync
Current DC: virt-002.cluster-qe.lab.eng.brq.redhat.com (2) - partition with quorum
Version: 1.1.10-1.el7-138556c
2 Nodes configured, unknown expected votes
2 Resources configured.
Online: [ virt-001.cluster-qe.lab.eng.brq.redhat.com virt-002.cluster-qe.lab.eng.brq.redhat.com ]
Full list of resources:
virt-fencing (stonith:fence_xvm): Started virt-001.cluster-qe.lab.eng.brq.redhat.com
haa-apache (ocf::heartbeat:apache): Stopped
Failed actions:
haa-apache_start_0 (node=virt-002.cluster-qe.lab.eng.brq.redhat.com, call=39, rc=1, status=complete): unknown error
haa-apache_start_0 (node=virt-001.cluster-qe.lab.eng.brq.redhat.com, call=42, rc=1, status=complete): unknown error
# tail /var/log/httpd/error_log
... [core:notice] [pid 12312] SELinux policy enabled; httpd running as context unconfined_u:system_r:unconfined_t:s0-s0:c0.c1023
... [suexec:notice] [pid 12312] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
... [auth_digest:notice] [pid 12313] AH01757: generating secret for digest authentication ...
... [lbmethod_heartbeat:notice] [pid 12313] AH02282: No slotmem from mod_heartmonitor
... [mpm_prefork:notice] [pid 12313] AH00163: Apache/2.4.4 (Red Hat) configured -- resuming normal operations
... [core:notice] [pid 12313] AH00094: Command line: '/sbin/httpd -D STATUS -f /etc/httpd/conf/httpd.conf -c PidFile /var/run//httpd.pid'
... [mpm_prefork:notice] [pid 12313] AH00169: caught SIGTERM, shutting down
It seems that patch did its work and added "-c Pidfile /var/run/httd.pid" but
resource is still not started. What am I doing wrong?
It works when there is "PidFile ..." line in httpd.conf but as far as I know it
is not mandatory so the resource should not depend on it.
This is working for me. Did you set the status url in the httpd.conf file? http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-single/Clusters_from_Scratch/index.html#_enable_the_apache_status_url I'll attach my httpd.conf. Created attachment 761316 [details]
example httpd.conf
My bad. It is need to enable server-status location and create resource with it. With this done apache runs nicely even without "PidFile ..." line in httpd config. GOOD version: resource-agents-3.9.5-4.el7.x86_64 # cat /etc/httpd/conf.d/server-status.conf <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 </Location> # pcs resource show haa-apache Resource: haa-apache (class=ocf provider=heartbeat type=apache) Attributes: configfile=/etc/httpd/conf/httpd.conf statusurl=http://localhost/server-status Operations: monitor interval=30s (haa-apache-monitor-interval-30s) # pcs status Cluster name: STSRHTS20736 Last updated: Fri Jun 14 17:40:02 2013 Last change: Fri Jun 14 17:36:29 2013 via cibadmin on virt-001.cluster-qe.lab.eng.brq.redhat.com Stack: corosync Current DC: virt-002.cluster-qe.lab.eng.brq.redhat.com (2) - partition with quorum Version: 1.1.10-1.el7-138556c 2 Nodes configured, unknown expected votes 2 Resources configured. Online: [ virt-001.cluster-qe.lab.eng.brq.redhat.com virt-002.cluster-qe.lab.eng.brq.redhat.com ] Full list of resources: virt-fencing (stonith:fence_xvm): Started virt-001.cluster-qe.lab.eng.brq.redhat.com haa-apache (ocf::heartbeat:apache): Started virt-002.cluster-qe.lab.eng.brq.redhat.com The fact you hit this status-url error with no indication as to what the problem was means there's room for improvement. I'm adding error output to this agent to make the problem more obvious. This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |
Created attachment 702003 [details] "cibadmin --query" output from the first node Description of problem: Cluster resource ocf:heartbeat:apache does not run. Version-Release number of selected component (if applicable): resource-agents-3.9.2-5.el7.x86_64 RHEL-7.0-20130131.0 How reproducible: always Steps to Reproduce: 1. have running corosync+pacemaker cluster 2. pcs resource create haa-apache ocf:heartbeat:apache params \ configfile=/etc/httpd/conf/httpd.conf op monitor interval=30s 3. pcs resource start ha-apache Actual results: resource in stopped state. Expected results: resource in running state. logging of what went wrong. Additional info: aa-node01:~]$ pcs status Last updated: Sun Feb 24 07:01:19 2013 Last change: Sun Feb 24 07:07:47 2013 via cibadmin on aa-node01 Stack: corosync Current DC: aa-node02 (2) - partition with quorum Version: 1.1.8-4.el7-5db5f53 2 Nodes configured, unknown expected votes 1 Resources configured. Online: [ aa-node01 aa-node02 ] Full list of resources: virt-fencing (stonith:fence_xvm): Started aa-node01 aa-node01:~]$ pcs resource create haa-apache ocf:heartbeat:apache params \ configfile=/etc/httpd/conf/httpd.conf op monitor interval=30s aa-node01:~]$ pcs status Last updated: Sun Feb 24 07:05:41 2013 Last change: Sun Feb 24 07:09:35 2013 via cibadmin on aa-node01 Stack: corosync Current DC: aa-node02 (2) - partition with quorum Version: 1.1.8-4.el7-5db5f53 2 Nodes configured, unknown expected votes 2 Resources configured. Online: [ aa-node01 aa-node02 ] Full list of resources: virt-fencing (stonith:fence_xvm): Started aa-node01 haa-apache (ocf::heartbeat:apache): Stopped Failed actions: haa-apache_start_0 (node=aa-node01, call=78, rc=1, status=Timed Out): unknown error haa-apache_start_0 (node=aa-node02, call=94, rc=1, status=Timed Out): unknown error aa-node01:~]$ pcs resource show haa-apache Resource: haa-apache configfile: /etc/httpd/conf/httpd.conf op monitor interval=30s aa-node01:~]$ pcs resource start haa-apache aa-node01:~]$ pcs status Last updated: Sun Feb 24 07:06:31 2013 Last change: Sun Feb 24 07:09:35 2013 via cibadmin on aa-node01 Stack: corosync Current DC: aa-node02 (2) - partition with quorum Version: 1.1.8-4.el7-5db5f53 2 Nodes configured, unknown expected votes 2 Resources configured. Online: [ aa-node01 aa-node02 ] Full list of resources: virt-fencing (stonith:fence_xvm): Started aa-node01 haa-apache (ocf::heartbeat:apache): Stopped Failed actions: haa-apache_start_0 (node=aa-node01, call=78, rc=1, status=Timed Out): unknown error haa-apache_start_0 (node=aa-node02, call=94, rc=1, status=Timed Out): unknown error