httpdリソース監視の追加

primitive httpd_4 lsb:httpd \
        op monitor interval="10s"

はデフォルトのheartbeatによるhttpdリソース監視
これをPacemakerで管理したい
ということで、ApacheリソースをPacemakerで管理することに。
以下の設定を追加

crm(live)configure# primitive res_httpd ocf:heartbeat:apache \
params \
httpd="/usr/sbin/httpd" \
configfile="/etc/httpd/conf/httpd.conf" \
op start interval="0s" timeout="60s" on-fail="restart" \
op monitor interval="10s" timeout="60s" on-fail="restart" \
op stop interval="0s" timeout="60s" on-fail="block"

group から httpd_4 を削除して新たに res_httpd を追加

group group_1 IPaddr2_1 Filesystem_3 res_httpd

挑戦!Pacemakerで自由自在にクラスタリングP80〜82
ところが止めても止めてもhttpdが勝手に再起動されてしまう。
どうやらheartbeatが勝手に再起動してるっぽい。
なので下記を削除しようとしたが、上書きしようとするとどうしても下記のエラーが出てしまう。

primitive httpd_4 lsb:httpd \
        op monitor interval="10s"

"/tmp/tmpkXKqMQ" 44L, 1893C 書込み 
WARNING: resource httpd_4 is running, can't delete it

なので heartbeat → httpd の順番で停止したら削除できた。

[root@z151 ~]#  service heartbeat stop
Stopping High-Availability services:                       [  OK  ]
[root@z151 ~]#  service httpd stop
httpd を停止中:                                            [失敗]
[root@z151 ~]#  service httpd status
httpd は停止しています

現在のクラスタ設定↓

node $id="4b6dd4d0-21f5-cd4c-2ca1-f8a45c55b02f" z151.drbd
node $id="c7c991cf-414b-8daa-6e5d-8c4e2e4bb197" z152.drbd
primitive Filesystem_3 ocf:heartbeat:Filesystem \
        op monitor interval="120s" timeout="60s" \
        params device="/dev/drbd0" directory="/mnt" fstype="ext3" options="noatime"
primitive IPaddr2_1 ocf:heartbeat:IPaddr2 \
        op monitor interval="5s" timeout="5s" \
        params ip="192.168.11.182" cidr_netmask="24" nic="eth0" broadcast="192.168.11.255"
primitive drbddisk_2 ocf:linbit:drbd \
        op monitor interval="10s" \
        params drbd_resource="r0"
primitive res_httpd ocf:heartbeat:apache \
        params httpd="/usr/sbin/httpd" configfile="/etc/httpd/conf/httpd.conf" \
        op start interval="0s" timeout="60s" on-fail="restart" \
        op monitor interval="10s" timeout="60s" on-fail="restart" \
        op stop interval="0s" timeout="60s" on-fail="block" \
        meta migration-threshold="1" failure-timeout="60s"
group group_1 IPaddr2_1 Filesystem_3 res_httpd
ms ms_drbd0 drbddisk_2 \
        meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"
location rsc_location_group_1 group_1 \
        rule $id="preferred_location_group_1" 100: #uname eq z151.drbd
colocation c_group_1 inf: group_1 ms_drbd0:Master
order o_drbd_befor_group_1 inf: ms_drbd0:promote group_1:start
property $id="cib-bootstrap-options" \
        symmetric-cluster="true" \
        no-quorum-policy="ignore" \
        default-resource-stickiness="0" \
        default-resource-failure-stickiness="0" \
        stonith-enabled="false" \
        stonith-action="reboot" \
        startup-fencing="true" \
        stop-orphan-resources="true" \
        stop-orphan-actions="true" \
        remove-after-stop="false" \
        short-resource-names="true" \
        transition-idle-timeout="5min" \
        default-action-timeout="20s" \
        is-managed-default="true" \
        cluster-delay="60s" \
        pe-error-series-max="-1" \
        pe-warn-series-max="-1" \
        pe-input-series-max="-1" \
        dc-version="1.0.9-89bd754939df5150de7cd76835f98fe90851b677" \
        cluster-infrastructure="Heartbeat"