[Pacemaker] Possible to colocate ms ressource with standard ones ?

Sékine Coulibaly scoulibaly at gmail.com
Tue Apr 29 13:06:22 UTC 2014


Hi,

Let me explain my use case. I'm using RHEL 6.3 with Corosync + Pacemaker +
PostgreSQL9.2 + repmgr 2.0. I have two nodes names clustera and clusterb.

I have a total of 3 resources :
- APACHE
- BOUM
- MS_POSTGRESQL

They are defined as follow :

sudo crm configure  primitive APACHE ocf:heartbeat:apache \
   params configfile=/etc/httpd/conf/httpd.conf \
   op monitor interval=5s timeout=10s \
   op start interval=0 timeout=10s \
   op stop interval=0 timeout=10s

 sudo crm configure primitive BOUM ocf:heartbeat:anything \
   params binfile=/usr/local/boum/current/bin/boum \
   workdir=/var/boum \
   logfile=/var/log/boum/boum_STDOUT \
   errlogfile=/var/log/boum/boum_STDERR \
   pidfile=/var/run/boum.pid \
   op monitor interval=5s timeout=10s \
   op start interval=0 timeout=10s \
   op stop interval=0 timeout=10s

sudo crm configure primitive POSTGRESQL ocf:xxxxxx:postgresql \
   params repmgr_conf=/var/lib/pgsql/repmgr/repmgr.conf
pgctl=/usr/pgsql-9.2/bin/pg_ctl pgdata=/opt/pgdata \
   op start interval=0 timeout=90s \
   op stop interval=0 timeout=60s \
   op promote interval=0 timeout=120s \
   op monitor interval=53s role=Master \
   op monitor interval=60s role=Slave

Since the PostgreSQL is in streaming replication, I need to have a master
and a slave constantly running. Hence, I created an MasterSlave resource,
called MS_POSTGRESQL.

I want to that APACHE, BOUM and the master node of PostgreSQL run
altogether on the same node. It looks like that as soon as I add a
colocation, the Postgresql slave doesn't start anymore.

I end up with :

Online: [ clusterb clustera ]

 Master/Slave Set: MS_POSTGRESQL [POSTGRESQL]
     Masters: [ clustera ]
     Stopped: [ POSTGRESQL:1 ]
APACHE  (ocf::heartbeat:apache):        Started clustera
BOUM     (ocf::heartbeat:anything): Started clustera

My configuration is as follows :


node clustera \
        attributes standby="off"
node clusterb \
        attributes standby="off"
primitive APACHE ocf:heartbeat:apache \
        params configfile="/etc/httpd/conf/httpd.conf" \
        op monitor interval="5s" timeout="10s" \
        op start interval="0" timeout="10s" \
        op stop interval="0" timeout="10s" \
        meta target-role="Started"
primitive BOUM ocf:heartbeat:anything \
        params binfile="/usr/local/boum/current/bin/boum"
workdir="/var/boum" logfile="/var/log/boum/boum_STDOUT"
errlogfile="/var/log/boum/boum_STDERR" pidfile="/var/run/boum.pid" \
        op monitor interval="5s" timeout="10s" \
        op start interval="0" timeout="10s" \
        op stop interval="0" timeout="10s"
primitive POSTGRESQL ocf:xxxxxxx:postgresql \
        params repmgr_conf="/var/lib/pgsql/repmgr/repmgr.conf"
pgctl="/usr/pgsql-9.2/bin/pg_ctl" pgdata="/opt/pgdata" \
        op start interval="0" timeout="90s" \
        op stop interval="0" timeout="60s" \
        op promote interval="0" timeout="120s" \
        op monitor interval="53s" role="Master" \
        op monitor interval="60s" role="Slave"
ms MS_POSTGRESQL POSTGRESQL \
        meta clone-max="2" target-role="Started" resource-stickiness="100"
notify="true"
colocation link-resources inf: ZK UFO BOUM APACHE MS_POSTGRESQL
property $id="cib-bootstrap-options" \
        dc-version="1.1.7-6.el6-148fccfd5985c5590cc601123c6c16e966b85d14" \
        cluster-infrastructure="openais" \
        expected-quorum-votes="2" \
        stonith-enabled="false" \
        no-quorum-policy="ignore" \
        default-resource-stickiness="10" \
        start-failure-is-fatal="false" \
        last-lrm-refresh="1398775386"

Is this a normal behaviour ? If it is, is there a workaround I didn't think
of ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20140429/11c99579/attachment-0003.html>


More information about the Pacemaker mailing list