 
Pacemaker+DRBD+GFS2構築 Pacemakerのリソース登録
Apache設定
■Apacheのserver-status設定 # vi /etc/httpd/conf/httpd.conf
 <location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
 </location>
# chkconfig httpd off
Pacemakerのリソース登録
■CRMコマンドのインストール# yum install python-dateutil python-lxml # rpm -Uvh http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/RedHat_RHEL-6/x86_64/pssh-2.3.1-3.2.x86_64.rpm # rpm -Uvh http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/RedHat_RHEL-6/x86_64/crmsh-1.2.6-5.1.x86_64.rpm※URL: http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/RedHat_RHEL-6/x86_64/ の最新パッケージをインストールする(pssh,crmsh)
# crm configure edit
node img-server01-rep \
        attributes standby="off"
node img-server02-rep \
        attributes standby="off"
primitive p_dlm ocf:pacemaker:controld \
        op start interval="0" timeout="90s" \
        op stop interval="0" timeout="100s" \
        op monitor interval="20s" on-fail="restart"
primitive p_drbd_r0 ocf:linbit:drbd \
        params drbd_resource="r0" \
        op start interval="0" timeout="240s" \
        op stop interval="0" timeout="100s" 
primitive p_fs_r0 ocf:heartbeat:Filesystem \
        params device="/dev/drbd0" directory="/data" fstype="gfs2" \
        op start interval="0" timeout="60s" \
        op stop interval="0" timeout="60s" \
        op monitor interval="20s" timeout="40s" on-fail="restart"
primitive p_gfs ocf:pacemaker:controld \
        params daemon="gfs_controld" args="-g 0" \
        op start interval="0" timeout="120s" \
        op stop interval="0" timeout="100s" \
        op monitor interval="20s" on-fail="restart"
primitive p_httpd ocf:heartbeat:apache \
        params configfile="/etc/httpd/conf/httpd.conf" \
        op start interval="0" timeout="60s" \
        op stop interval="0" timeout="60s" \
        op monitor interval="60s" timeout="40s" on-fail="restart"
ms ms_drbd_r0 p_drbd_r0 \
        meta master-max="2" master-node-max="1" clone-max="2" clone-node-max="1" notify="true" target-role="Started"
clone cl_fs_r0 p_fs_r0 \
        meta interleave="true"
clone cl_gfs p_gfs \
        meta interleave="true"
clone cl_httpd p_httpd
clone cl_p_dlm p_dlm \
        meta interleave="true"
colocation co_fs_with_drbd inf: cl_fs_r0 ms_drbd_r0:Master
colocation co_gfs_with_dlm inf: cl_gfs cl_p_dlm
colocation co_httpd_with_fs inf: cl_httpd cl_fs_r0
order o_dlm_before_gfs inf: cl_p_dlm cl_gfs
order o_drbd_before_fs inf: ms_drbd_r0:promote cl_fs_r0:start
order o_fs_before_httpd inf: cl_fs_r0 cl_httpd
order o_gfs_before_fs inf: cl_gfs cl_fs_r0
property $id="cib-bootstrap-options" \
        dc-version="1.1.8-7.el6-394e906" \
        cluster-infrastructure="cman" \
        no-quorum-policy="ignore" \
        stonith-enabled="false"
# chkconfig pacemaker on
Pacemaker+DRBD+GFS2構築(デュアルプライマリ構成)の構築概要
00. Pacemaker+DRBD+GFS2構築 環境/基本情報