I am having a problem deploying nginx + corosync + pacemaker. I've already configured the fail-over setup using a virtual IP, now I want to add nginx hi-availability service to pacemaker.
Here is my problem. I've already configured pacemaker resource to use ocf:heartbeat:nginx but when starting pacemaker service, it won't start properly. I am having an error
Mar 8 05:10:53 centos lrmd: : info: RA output: (nginx_res:start:stderr) /usr/lib/ocf/resource.d//heartb eat/nginx: line 401: [: too many arguments
Mar 8 05:10:53 centos nginx: : INFO: nginx not running
Mar 8 05:10:53 centos nginx: : INFO: Waiting for /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf to come up (try 27)
Here's my configuration:
primitive website ocf:heartbeat:nginx \
params configfile="/usr/local/nginx/conf/nginx.conf" httpd="/usr/local/nginx/sbin/nginx" status10url="http://192.168.0.211" \
op monitor interval="10s" timeout="30s" \
op start interval="0" timeout="40s" \
op stop interval="0" timeout="60s"
Also tried this config, but with this I am having problems with nginx not properly killed when fail-over occurs (transfer from centos to centos2) due to nginx PID not recorded to the nginx.pid file.
primitive website ocf:heartbeat:anything \
params binfile="/usr/local/nginx/sbin/nginx" cmdline_options="-g 'pid /usr/local/nginx/logs/nginx.pid;'" pidfile="/usr/local/nginx/logs/nginx.pid" \
op monitor interval="5s"
Please advise. Thanks