LINUX.ORG.RU
решено ФорумAdmin

pacemaker + mysql + asterisk + httpd

 , , ,


2

1

Добрый день Подскажите как настроить чтобы при переключении между нодами выключались службы mysqld и httpd? Сейчас при переключении гасится только asterisk.

Конфиг pacemaker.cfg.

node astnode01
node astnode02
primitive Asterisk ocf:Digium:asterisk \
        op monitor interval="5"
primitive Asterisk_drbd ocf:linbit:drbd \
        params drbd_resource="asterisk" \
        op monitor start-delay="10" interval="5"
primitive Asterisk_fs ocf:heartbeat:Filesystem \
        params device="/dev/drbd/by-res/asterisk" directory="/mnt/asterisk/" fstype="ext3"
primitive ClusterIP ocf:heartbeat:IPaddr2 \
        params ip="10.4.2.151" cidr_netmask="32" \
        op monitor interval="5"
primitive GatewayStatus ocf:pacemaker:ping \
        params host_list="10.4.2.1" multiplier="100" \
        op monitor interval="5" timeout="10"
primitive rseries0 ocf:Digium:rseries \
        params tty="/dev/rseries0" \
        op monitor interval="10" role="Master" \
        op monitor interval="60" role="Slave"
ms Asterisk_ms Asterisk_drbd \
        meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"
ms rseries0_ms rseries0 \
        meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" target-role="Master"
clone GatewayStatusClone GatewayStatus
location Asterisk-with-ping Asterisk \
        rule $id="Asterisk-with-ping-rule" -inf: not_defined pingd or pingd lte 0
colocation Everything-with-Asterisk inf: ( rseries0_ms:Master Asterisk_ms:Master ) ( ClusterIP Asterisk_fs ) Asterisk
order Asterisk-after-Everything inf: ( rseries0_ms:promote Asterisk_ms:promote ) ( ClusterIP Asterisk_fs ) Asterisk:start
property $id="cib-bootstrap-options" \
        dc-version="1.0.12-unknown" \
        cluster-infrastructure="openais" \
        expected-quorum-votes="2" \
        stonith-enabled="false" \
        no-quorum-policy="ignore"
rsc_defaults $id="rsc-options" \
        resource-stickiness="99"

Пробовал добавлять

primitive Asterisk_httpd ocf:heartbeat:apache \
        params configfile="/etc/httpd/conf/httpd.conf" \
        op start interval="0s" timeout="60s" \
        op monitor interval="5s" timeout="20s" \
        op stop interval="0s" timeout="60s"
Выводит ошибку
[root@astnode01 ~]# crm status
============
Last updated: Wed Sep  3 12:26:25 2014
Stack: openais
Current DC: astnode02 - partition with quorum
Version: 1.0.12-unknown
2 Nodes configured, 2 expected votes
7 Resources configured.
============
 
Online: [ astnode01 astnode02 ]
 
 Asterisk       (ocf::Digium:asterisk): Started astnode02
 Asterisk_fs    (ocf::heartbeat:Filesystem):    Started astnode02
 ClusterIP      (ocf::heartbeat:IPaddr2):       Started astnode02
 Master/Slave Set: Asterisk_ms
     Masters: [ astnode02 ]
     Slaves: [ astnode01 ]
 Master/Slave Set: rseries0_ms
     Masters: [ astnode02 ]
     Slaves: [ astnode01 ]
 Clone Set: GatewayStatusClone
     Started: [ astnode01 astnode02 ]
 
Failed actions:
    Asterisk_httpd_start_0 (node=astnode02, call=18, rc=-2, status=Timed Out): unknown exec error
    Asterisk_httpd_start_0 (node=astnode01, call=9, rc=1, status=complete): unknown error



Последнее исправление: mkondratev (всего исправлений: 1)

Сделал. Рабочий конфиг:

node astnode01 \
        attributes standby="off"
node astnode02
primitive Asterisk ocf:Digium:asterisk \
        op monitor interval="5"
primitive Asterisk_drbd ocf:linbit:drbd \
        params drbd_resource="asterisk" \
        op monitor start-delay="10" interval="5"
primitive Asterisk_fs ocf:heartbeat:Filesystem \
        params device="/dev/drbd/by-res/asterisk" directory="/mnt/asterisk/" fstype="ext3"
primitive ClusterIP ocf:heartbeat:IPaddr2 \
        params ip="10.4.2.151" cidr_netmask="32" \
        op monitor interval="5"
primitive GatewayStatus ocf:pacemaker:ping \
        params host_list="10.4.2.1" multiplier="100" \
        op monitor interval="5" timeout="10"
primitive Http lsb:httpd
primitive Mysql lsb:mysqld
primitive rseries0 ocf:Digium:rseries \
        params tty="/dev/rseries0" \
        op monitor interval="10" role="Master" \
        op monitor interval="60" role="Slave"
ms Asterisk_ms Asterisk_drbd \
        meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"
ms rseries0_ms rseries0 \
        meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" target-role="Master"
clone GatewayStatusClone GatewayStatus
location Asterisk-with-ping Asterisk \
        rule $id="Asterisk-with-ping-rule" -inf: not_defined pingd or pingd lte 0
colocation Everything-with-Asterisk inf: ( rseries0_ms:Master Asterisk_ms:Master ) ( ClusterIP Asterisk_fs ) Asterisk Http Mysql
order Asterisk-after-Everything inf: ( rseries0_ms:promote Asterisk_ms:promote ) ( ClusterIP Asterisk_fs ) Asterisk:start Http:start Mysql:start
property $id="cib-bootstrap-options" \
        dc-version="1.0.12-unknown" \
        cluster-infrastructure="openais" \
        expected-quorum-votes="2" \
        stonith-enabled="false" \
        no-quorum-policy="ignore"
rsc_defaults $id="rsc-options" \
        resource-stickiness="99"

mkondratev
() автор топика
Ответ на: комментарий от mkondratev

точно рабочий? что то я не понимаю у тебя в правилах есть ссылка на

location Asterisk-with-ping Asterisk \
        rule $id="Asterisk-with-ping-rule" -inf: not_defined pingd or pingd lte 0

а сам pingd не определен в конфиге

Yur4eg ★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.