0

I want use corosync+pacemaker+zabbix to achieve high availability. Follow is my config

crm(live)configure# show
node zabbix1 \
attributes standby="off" timeout="60"
node zabbix2 \
attributes standby="off"
primitive httpd lsb:httpd \
op monitor interval="10s"
primitive vip ocf:heartbeat:IPaddr \
params ip="192.168.56.110" nic="eth0" cidr_netmask="24" \
op monitor interval="10s"
primitive zabbix-ha lsb:zabbix_server \
op monitor interval="30s" timeout="20s" \
op start interval="0s" timeout="40s" \
op stop interval="0s" timeout="60s" 
group webservice vip httpd zabbix-ha
property $id="cib-bootstrap-options" \
dc-version="1.1.8-7.el6-394e906" \
cluster-infrastructure="classic openais (with plugin)" \
expected-quorum-votes="2" \
stonith-enabled="false" \
last-lrm-refresh="1377489711" \
no-quorum-policy="ignore"
rsc_defaults $id="rsc-options" \
resource-stickiness="100"

and my crm_mon status is:

Last updated: Mon Aug 26 18:52:48 2013
Last change: Mon Aug 26 18:52:33 2013 via cibadmin on zabbix1
Stack: classic openais (with plugin)
Current DC: zabbix1 - partition with quorum
Version: 1.1.8-7.el6-394e906
2 Nodes configured, 2 expected votes
3 Resources configured.


Node zabbix1: online
    httpd   (lsb:httpd):    Started
    vip     (ocf::heartbeat:IPaddr):        Started
    zabbix-ha   (lsb:zabbix_server):    Started
Node zabbix2: online

now i stop zabbix-ha service on the zabbix1, I wait for 300s, pacemaker can't start my zabbix-ha service:

[root@zabbix1 tmp]# ps -ef|grep zabbix
root     13287 31252  0 18:59 pts/2    00:00:00 grep zabbix

and my zabbix-ha script is i can use crm resource stop/start zabbix-ha to stop/start my zabbix-ha.

oldNoakes
  • 549
  • 1
  • 5
  • 14
Alan.deng
  • 1
  • 1

1 Answers1

0

I'm not use zabbix default script(address is zabbix-2.0.6/misc/init.d/fedora/core/zabbix_serve),I create lsb script by myself.Follow is my script for zabbix_server(i put it in the /etc/init.d)

    #!/bin/bash
    #
    # zabbix:       Control the zabbix Daemon
    #
    # author:   Denglei
    #
    # blog:     http://dl528888.blog.51cto.com/
    # description: This is a init.d script for zabbix. Tested on CentOS6. \
    #              Change DAEMON and PIDFILE if neccessary.
    #

#Location of zabbix binary. Change path as neccessary
DAEMON=/usr/local/zabbix/sbin/zabbix_server
NAME=`basename $DAEMON`
#Pid file of zabbix, should be matched with pid directive in nginx config file.
PIDFILE=/tmp/$NAME.pid
#this file location
SCRIPTNAME=/etc/init.d/$NAME
#only run if binary can be found
test -x $DAEMON || exit 0
RETVAL=0

start() {
echo $"Starting $NAME"
$DAEMON
RETVAL=0
}

stop() {
echo $"Graceful stopping $NAME"
[ -s "$PIDFILE" ] && kill -QUIT `cat $PIDFILE`
RETVAL=0
}

forcestop() {
echo $"Quick stopping $NAME"
[ -s "$PIDFILE" ] && kill -TERM `cat $PIDFILE`
RETVAL=$?
}

reload() {
echo $"Graceful reloading $NAME configuration"
[ -s "$PIDFILE" ] && kill -HUP `cat $PIDFILE`
RETVAL=$?
}

status() {
if [ -s $PIDFILE ]; then
    echo $"$NAME is running."
    RETVAL=0
else
    echo $"$NAME stopped."
    RETVAL=3
fi
}
# See how we were called.
case "$1" in
start)
    start
    ;;
stop)
    stop
    ;;
force-stop)
    forcestop
    ;;
restart)
    stop
    start
    ;;
reload)
    reload
    ;;
status)
    status
    ;;
*)
    echo $"Usage: $0 {start|stop|force-stop|restart|reload|status}"
    exit 1
esac

exit $RETVAL
</pre>
Alan.deng
  • 1
  • 1