[Pacemaker] Help to configure a cluster with pacemaker

Josué Alcalde González josue.alcalde at csa.es
Thu Sep 2 17:01:52 UTC 2010


First, as i am new in this list I would like hello to everybody.

I have configured a 4 node cluster with ubuntu 10.04 with a simple
architecture.
All nodes are the same machine, with a root partition and a data
partition shared with drbd.

node1: First apache webserver node
node2: Second apache webserver node
node1 and node2 has a drbd resource called webserversdisk in
master/slave using ext4.

node3: First mysql server
node4: Second mysql server
node3 and node4 has a drbd resource called webserversdisk in
master/slave using ext4.

DRBD is using Master/Slave without OCFS or GFS (it uses EXT4) so there
will be only one node with apache2 and one node with mysql.


The problem is I am getting some problem with location and colocation.
In fact, my apache primitive try to start in ubuntu02, ubuntu03 and
ubuntu04 instead of ubuntu01, where my drbd webserverdisk is mounted.
Of course, apache is not starting because it only can works if the
webserverdisk is mounted in the machine.

My pacemaker configuration is this (I think some location directives are
not needed):

node ubuntu01
node ubuntu02 
node ubuntu03
node ubuntu04
primitive apache lsb:apache2 \
        meta target-role="Started"
primitive drbd_disk_dataserver ocf:linbit:drbd \
        params drbd_resource="dataserverdisk" \
        op monitor interval="15s"
primitive drbd_disk_webserver ocf:linbit:drbd \
        params drbd_resource="webserverdisk" \
        op monitor interval="15s"
primitive fs_drbd_dataserver ocf:heartbeat:Filesystem \
        params device="/dev/drbd/by-res/dataserverdisk"
directory="/srv/data" fstype="ext4"
primitive fs_drbd_webserver ocf:heartbeat:Filesystem \
        params device="/dev/drbd/by-res/webserverdisk"
directory="/srv/data" fstype="ext4"
primitive ip_cluster_dataserver ocf:heartbeat:IPaddr2 \
        params ip="172.16.15.106" nic="eth0:0"
primitive ip_cluster_webserver ocf:heartbeat:IPaddr2 \
        params ip="172.16.15.105" nic="eth0:0"
primitive mysqld lsb:mysql \
        meta target-role="Started"
group group_dataserver fs_drbd_dataserver ip_cluster_dataserver mysqld \
        meta target-role="Started"
group group_webserver fs_drbd_webserver ip_cluster_webserver apache \
        meta target-role="Started"
ms ms_drbd_dataserver drbd_disk_dataserver \
        meta master-max="1" master-node-max="1" clone-max="2"
clone-node-max="1" notify="true" target-role="Started"
ms ms_drbd_webserver drbd_disk_webserver \
        meta master-max="1" master-node-max="1" clone-max="2"
clone-node-max="1" notify="true" target-role="Started"
location location_dataserver_1 ms_drbd_dataserver 200: ubuntu03
location location_dataserver_1_fs_drbd fs_drbd_dataserver 200: ubuntu03
location location_dataserver_1_group group_dataserver 200: ubuntu03
location location_dataserver_1_ip_cluster ip_cluster_dataserver 200:
ubuntu03
location location_dataserver_1_mysqld mysqld 200: ubuntu03
location location_dataserver_2 ms_drbd_dataserver 100: ubuntu04
location location_dataserver_2_fs_drbd fs_drbd_dataserver 100: ubuntu04
location location_dataserver_2_group group_dataserver 100: ubuntu04
location location_dataserver_2_ip_cluster ip_cluster_dataserver 100:
ubuntu04
location location_dataserver_2_mysqld mysqld 100: ubuntu04
location location_dataserver_3 ms_drbd_dataserver -inf: ubuntu01
location location_dataserver_3_fs_drbd fs_drbd_dataserver -inf: ubuntu01
location location_dataserver_3_group group_dataserver -inf: ubuntu01
location location_dataserver_3_ip_cluster ip_cluster_dataserver -inf:
ubuntu01
location location_dataserver_3_mysqld mysqld -inf: ubuntu01
location location_dataserver_4 ms_drbd_dataserver -inf: ubuntu02
location location_dataserver_4_fs_drbd fs_drbd_dataserver -inf: ubuntu02
location location_dataserver_4_group group_dataserver -inf: ubuntu02
location location_dataserver_4_ip_cluster ip_cluster_dataserver -inf:
ubuntu02
location location_dataserver_4_mysqld mysqld -inf: ubuntu02
location location_webserver_1 ms_drbd_webserver 200: ubuntu01
location location_webserver_1_apache2 apache 200: ubuntu01
location location_webserver_1_fs_drbd fs_drbd_webserver 200: ubuntu01
location location_webserver_1_group group_webserver 200: ubuntu01
location location_webserver_1_ip_cluster ip_cluster_webserver 200:
ubuntu01
location location_webserver_2 ms_drbd_webserver 100: ubuntu02
location location_webserver_2_apache2 apache 100: ubuntu02
location location_webserver_2_fs_drbd fs_drbd_webserver 100: ubuntu02
location location_webserver_2_group group_webserver 100: ubuntu02
location location_webserver_2_ip_cluster ip_cluster_webserver 100:
ubuntu02
location location_webserver_3 ms_drbd_webserver -inf: ubuntu03
location location_webserver_3_apache2 apache -inf: ubuntu03
location location_webserver_3_fs_drbd fs_drbd_webserver -inf: ubuntu03
location location_webserver_3_group group_webserver -inf: ubuntu03
location location_webserver_3_ip_cluster ip_cluster_webserver -inf:
ubuntu03
location location_webserver_4 ms_drbd_webserver -inf: ubuntu04
location location_webserver_4_apache2 apache -inf: ubuntu04
location location_webserver_4_fs_drbd fs_drbd_webserver -inf: ubuntu04
location location_webserver_4_group group_webserver -inf: ubuntu04
location location_webserver_4_ip_cluster ip_cluster_webserver -inf:
ubuntu04
colocation mnt_on_master_dataserver inf: group_dataserver
ms_drbd_dataserver:Master
colocation mnt_on_master_webserver inf: group_webserver
ms_drbd_webserver:Master
order mount_after_drbd_dataserver inf: ms_drbd_dataserver:promote
fs_drbd_dataserver:start
order mount_after_drbd_webserver inf: ms_drbd_webserver:promote
fs_drbd_webserver:start
property $id="cib-bootstrap-options" \
        dc-version="1.0.8-042548a451fce8400660f6031f4da6f0223dd5dd" \
        cluster-infrastructure="openais" \
        default-resource-stickiness="200" \
        expected-quorum-votes="4" \
        no-quorum-policy="ignore" \
        stonith-enabled="false" \
        symmetric-cluster="false" \
        last-lrm-refresh="1283288149"


Also, this is the output of crm_mon:

============
Last updated: Thu Sep  2 18:59:05 2010
Stack: openais
Current DC: ubuntu01 - partition with quorum
Version: 1.0.8-042548a451fce8400660f6031f4da6f0223dd5dd
4 Nodes configured, 4 expected votes
4 Resources configured.
============

Online: [ ubuntu03 ubuntu04 ubuntu01 ubuntu02 ]

 Resource Group: group_dataserver
     fs_drbd_dataserver (ocf::heartbeat:Filesystem):    Started ubuntu04
     ip_cluster_dataserver      (ocf::heartbeat:IPaddr2):       Started ubuntu04
     mysqld     (lsb:mysql):    Started ubuntu04
 Master/Slave Set: ms_drbd_dataserver
     Masters: [ ubuntu04 ]
     Slaves: [ ubuntu03 ]
 Resource Group: group_webserver
     fs_drbd_webserver  (ocf::heartbeat:Filesystem):    Started ubuntu01
     ip_cluster_webserver       (ocf::heartbeat:IPaddr2):       Started ubuntu01
     apache     (lsb:apache2) Started [ ubuntu02        ubuntu03        ubuntu04 ]
 Master/Slave Set: ms_drbd_webserver
     Masters: [ ubuntu01 ]
     Slaves: [ ubuntu02 ]

Failed actions:
    mysqld_monitor_0 (node=ubuntu01, call=4, rc=5, status=complete): not installed
    mysqld_monitor_0 (node=ubuntu02, call=4, rc=5, status=complete): not installed
    apache_monitor_0 (node=ubuntu02, call=8, rc=254, status=complete): <unknown>
    apache_stop_0 (node=ubuntu02, call=10, rc=254, status=complete): <unknown>


Thanks for any help.





More information about the Pacemaker mailing list