[ClusterLabs] Howto use ocf:heartbeat:nginx check level > 0

user.clusterlabs.org at siimnet.dk user.clusterlabs.org at siimnet.dk
Sun Nov 8 10:26:14 CET 2015


Setting up my first pacemaker cluster, I’m trying to grasp howto make ocf:heartbeat:nginx monitor with check levels > 0.

Got this so far:

[root at afnA ~]# pcs resource
 Resource Group: afnGroup
     afnVIP     (ocf::heartbeat:IPaddr2):       Started afnA 
     afnNGinx   (ocf::heartbeat:nginx): Started afnA 

[root at afnA ~]# pcs resource describe ocf:heartbeat:nginx
ocf:heartbeat:nginx - Manages an Nginx web/proxy server instance

This is the resource agent for the Nginx web/proxy server.
This resource agent does not monitor POP or IMAP servers, as
we don't know how to determine meaningful status for them.

The start operation ends with a loop in which monitor is
repeatedly called to make sure that the server started and that
it is operational. Hence, if the monitor operation does not
succeed within the start operation timeout, the nginx resource
will end with an error status.

The default monitor operation will verify that nginx is running.

The level 10 monitor operation by default will try and fetch the /nginx_status
page - which is commented out in sample nginx configurations.
Make sure that the /nginx_status page works and that the access
is restricted to localhost (address 127.0.0.1) plus whatever
places _outside the cluster_ you want to monitor the server from.
See the status10url and status10regex attributes for more details.

The level 20 monitor operation will perform a more complex set of tests
from a configuration file.

The level 30 monitor operation will run an external command to perform
an arbitrary monitoring operation.

Resource options:
  configfile: The full pathname of the Nginx configuration file.This file is parsed to provide defaults for various otherresource agent parameters.
  httpd: The full pathname of the httpd binary (optional).
  port: A port number that we can probe for status informationusing the statusurl.This will default to the port number found in theconfiguration file, or 80, if none can be foundin the configuration file.
  status10url: The URL to monitor (the nginx server status page by default) when given a level 10 monitor operation.If left unspecified, it will be inferred fromthe nginx configuration file, or defaulted to /nginx_status.If you set this, make sure that
               it succeeds *only* from thelocalhost (127.0.0.1) and no other cluster nodes.Otherwise, the cluster software may complainabout it being active on multiple nodes.
  status10regex: Regular expression to match in the output of status10url.Case insensitive.
  testclient: Client to use to query to Nginx for level 10 and level 20 tests.If not specified, the RA will try to find one on the system.Currently, wget and curl are supported, with curl being preferred.For example, you can set this paramter to "wget"
              if you prefer that to curl.
  test20url: URL to test. If it does not start with "http", then it'sconsidered to be relative to the document root address.
  test20regex: Regular expression to match in the output of test20url.Case insensitive.
  test20conffile: A file which contains a more complex test configuration. Could be useful ifyou have to check more than one web application or in case sensitiveinfo should be passed as arguments (passwords). Furthermore,using a config file is the only
                  way to specify certain parameters.Please see README.webapps for examples and file description.
  test20name: Name of the test within the test configuration file.
  external_monitor30_cmd: Command string to run which implements level 30 monitoring.
  options: Extra options to apply when starting nginx.

[root at afnA ~]# pcs resource show afnNGinx
 Resource: afnNGinx (class=ocf provider=heartbeat type=nginx)
  Attributes: configfile=/opt/imail/nginx/conf/nginx.conf port=8080 httpd=/opt/imail/nginx/sbin/nginx options="-p /opt/imail/nginx" status10url=/ping status10regex=".+ is alive\." 
  Operations: start interval=0s timeout=60s (afnNGinx-start-interval-0s)
              stop interval=0s timeout=60s (afnNGinx-stop-interval-0s)
              monitor interval=10s timeout=20s (afnNGinx-monitor-interval-10s)
              monitor interval=60s timeout=20s (afnNGinx-monitor-interval-60s)
[root at afnA ~]# 

but I cant verify that pacemaker RA ever calls http://localhost:8080/ping <http://localhost:8080/ping>, why not?

Any pointers to info source(s) for better understanding RA configuration and maybe specially check levels?

TIA

/Steffen

Manual pinging shows in nginx log but never sees RA monitoring from check level 10:

[root at afnA ~]# wget -q -O - http://127.0.0.1:8080/ping
mss3 is alive.
[root at afnA ~]# sleep 60; wget -q -O - http://127.0.0.1:8080/ping
mss3 is alive.
[root at afnA ~]# tail -2 /opt/imail/nginx/logs/access.log
127.0.0.1 - - [08/Nov/2015:10:21:43 +0100] "GET /ping HTTP/1.0" 200 16 "-" "Wget/1.12 (linux-gnu)"
127.0.0.1 - - [08/Nov/2015:10:22:56 +0100] "GET /ping HTTP/1.0" 200 16 "-" "Wget/1.12 (linux-gnu)”



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://clusterlabs.org/pipermail/users/attachments/20151108/c1c096a1/attachment.html>


More information about the Users mailing list