Thomas Glanzmann wrote:
Hello,
I have the following setup: DRBD => ext3 => IPaddr2 => pgsql. I have the
following configured:

00_README:# Ressourcen hinzufügen:
00_README:
00_README:cibadmin -o resources -C -x 01_drbd
00_README:cibadmin -o resources -C -x 02_filesystem
00_README:cibadmin -o constraints -C -x 03_constraint_run_on
00_README:cibadmin -o constraints -C -x 04_order_drbd_before_fs0
00_README:cibadmin -o constraints -C -x 05_colocation_drbd_master_on_fs0
00_README:
00_README:cibadmin -o resources -C -x 06_ip_address
00_README:cibadmin -o resources -C -x 07_pgsql
00_README:
00_README:cibadmin -o constraints -C -x 08_order_fs0_before_pgsql
00_README:cibadmin -o constraints -C -x 09_order_ip0_before_pgsql
00_README:cibadmin -o constraints -C -x 10_colocation_pgsql_ip0
00_README:cibadmin -o constraints -C -x 11_colocation_pgsql_fs0
00_README:cibadmin -o constraints -C -x 12_colocation_fs0_ip0
00_README:
00_README:# DRBD / FS starten:
00_README:
00_README:crm_resource -r ms-drbd0 -v '#default' --meta -p target_role
00_README:crm_resource -r fs0 -v '#default' --meta -p target_role
00_README:crm_resource -r pgsql0 -v '#default' --meta -p target_role
00_README:
00_README:00_README
00_README:01_drbd
00_README:02_filesystem
00_README:03_constraint_run_on
00_README:04_order_drbd_before_fs0
00_README:05_colocation_drbd_master_on_fs0
00_README:06_ip_address
00_README:07_pgsql
00_README:08_order_fs0_before_pgsql
00_README:09_order_ip0_before_pgsql
00_README:10_colocation_pgsql_ip0
00_README:11_colocation_pgsql_fs0
00_README:12_colocation_fs0_ip0
01_drbd:       <master_slave id="ms-drbd0">
01_drbd:         <meta_attributes id="ma-ms-drbd0">
01_drbd:           <attributes>
01_drbd:             <nvpair id="ma-ms-drbd0-1" name="clone_max" value="2"/>
01_drbd:             <nvpair id="ma-ms-drbd0-2" name="clone_node_max" 
value="1"/>
01_drbd:             <nvpair id="ma-ms-drbd0-3" name="master_max" value="1"/>
01_drbd:             <nvpair id="ma-ms-drbd0-4" name="master_node_max" 
value="1"/>
01_drbd:             <nvpair id="ma-ms-drbd0-5" name="notify" value="yes"/>
01_drbd:             <nvpair id="ma-ms-drbd0-6" name="globally_unique" 
value="false"/>
01_drbd:             <nvpair id="ma-ms-drbd0-7" name="target_role" 
value="stopped"/>
01_drbd:           </attributes>
01_drbd:         </meta_attributes>
01_drbd:         <primitive id="drbd0" class="ocf" provider="heartbeat" 
type="drbd">
01_drbd:           <instance_attributes id="ia-drbd0">
01_drbd:             <attributes>
01_drbd:               <nvpair id="ia-drbd0-1" name="drbd_resource" 
value="postgres"/>
01_drbd:             </attributes>
01_drbd:           </instance_attributes>
01_drbd:         </primitive>
01_drbd:       </master_slave>
02_filesystem:<primitive class="ocf" provider="heartbeat" type="Filesystem" 
id="fs0">
02_filesystem:        <meta_attributes id="ma-fs0">
02_filesystem:                <attributes>
02_filesystem:                        <nvpair name="target_role" id="ma-fs0-1" 
value="stopped"/>
02_filesystem:                </attributes>
02_filesystem:        </meta_attributes>
02_filesystem:
02_filesystem:        <instance_attributes id="ia-fs0">
02_filesystem:                <attributes>
02_filesystem:                        <nvpair id="ia-fs0-1" name="fstype" 
value="ext3"/>
02_filesystem:                        <nvpair id="ia-fs0-2" name="directory" 
value="/srv/postgres"/>
02_filesystem:                        <nvpair id="ia-fs0-3" name="device" 
value="/dev/drbd0"/>
02_filesystem:                </attributes>
02_filesystem:        </instance_attributes>
02_filesystem:</primitive>
03_constraint_run_on:<rsc_location id="drbd0-placement-1" rsc="ms-drbd0">
03_constraint_run_on:        <rule id="drbd0-rule-1" score="-INFINITY">
03_constraint_run_on:                <expression id="exp-01" value="postgres-01" 
attribute="#uname" operation="ne"/>
03_constraint_run_on:                <expression id="exp-02" value="postgres-02" 
attribute="#uname" operation="ne"/>
03_constraint_run_on:        </rule>
03_constraint_run_on:</rsc_location>
04_order_drbd_before_fs0:<rsc_order id="drbd0_before_fs0" from="fs0" action="start" 
to="ms-drbd0" to_action="promote"/>
05_colocation_drbd_master_on_fs0:<rsc_colocation id="fs0_on_drbd0" to="ms-drbd0" to_role="master" 
from="fs0" score="infinity"/>
06_ip_address:<primitive class="ocf" provider="heartbeat" type="IPaddr2" 
id="ip0">
06_ip_address:        <meta_attributes id="ma-ip0">
06_ip_address:                <attributes>
06_ip_address:                        <nvpair name="target_role" id="ma-ip0-1" 
value="stopped"/>
06_ip_address:                </attributes>
06_ip_address:        </meta_attributes>
06_ip_address:
06_ip_address:        <instance_attributes id="ia-ip0">
06_ip_address:                <attributes>
06_ip_address:                        <nvpair id="ia-ip0-1" name="ip" 
value="172.17.0.20"/>
06_ip_address:                        <nvpair id="ia-ip0-2" name="cidr_netmask" 
value="24"/>
06_ip_address:                        <nvpair id="ia-ip0-3" name="nic" 
value="eth0.2"/>
06_ip_address:                </attributes>
06_ip_address:        </instance_attributes>
06_ip_address:</primitive>
07_pgsql:<primitive class="ocf" provider="heartbeat" type="pgsql" id="pgsql0">
07_pgsql:        <meta_attributes id="ma-pgsql0">
07_pgsql:                <attributes>
07_pgsql:                        <nvpair name="target_role" id="ma-pgsql0-1" 
value="stopped"/>
07_pgsql:                </attributes>
07_pgsql:        </meta_attributes>
07_pgsql:
07_pgsql:        <instance_attributes id="ia-pgsql0">
07_pgsql:                <attributes>
07_pgsql:                        <nvpair id="ia-pgsql0-1" name="pgctl" 
value="/usr/lib/postgresql/8.1/bin/pg_ctl"/>
07_pgsql:                        <nvpair id="ia-pgsql0-2" name="start_opt" 
value="--config_file=/etc/postgresql/8.1/main/postgresql.conf"/>
07_pgsql:                        <nvpair id="ia-pgsql0-3" name="pgdata" 
value="/srv/postgres/data"/>
07_pgsql:                        <nvpair id="ia-pgsql0-4" name="logfile" 
value="/srv/postgres/postgresql.log"/>
07_pgsql:                </attributes>
07_pgsql:        </instance_attributes>
07_pgsql:</primitive>
08_order_fs0_before_pgsql:<rsc_order id="fs0_before_pgsql" from="fs0" action="start" type="before" 
to="pgsql0" symmetrical="true">
09_order_ip0_before_pgsql:<rsc_order id="ip0_before_pgsql" from="ip0" action="start" type="before" 
to="pgsql0" symmetrical="true">
10_colocation_pgsql_ip0:<rsc_colocation id="ip0_on_pgsql0" from="ip0" to="pgsql0" 
score="infinity"/>
11_colocation_pgsql_fs0:<rsc_colocation id="fs0_on_pgsql0" from="fs0" to="pgsql0" 
score="infinity"/>
12_colocation_fs0_ip0:<rsc_colocation id="ip0_on_fs0" from="ip0" to="fs0" 
score="infinity"/>

What I don't get is the following: If I try to push the ip0 or pgsql0
ressource over to another host (the node where it currently is _not_
running), The ressources get stopped and nothing happens until I start
pushing after ressources over or push the ressource back:

(postgres-01) [~/ha_setup] crm_mon -1 -r


============
Last updated: Sun Dec 30 18:30:06 2007
Current DC: postgres-02 (211523e0-a549-49b7-bf29-f646915698ef)
2 Nodes configured.
4 Resources configured.
============

Node: postgres-02 (211523e0-a549-49b7-bf29-f646915698ef): online
Node: postgres-01 (24a3fa1b-6b62-470c-a6e1-4c1598875018): online

Full list of resources:

Master/Slave Set: ms-drbd0
    drbd0:0     (heartbeat::ocf:drbd):  Master postgres-01
    drbd0:1     (heartbeat::ocf:drbd):  Slave postgres-02
fs0     (heartbeat::ocf:Filesystem):    Started postgres-01
ip0     (heartbeat::ocf:IPaddr2):       Started postgres-01
pgsql0  (heartbeat::ocf:pgsql): Started postgres-01

(postgres-01) [~/ha_setup] crm_resource -M -r pgsql0 -H postgres-02

[ 30 seconds go by ]

(postgres-01) [~/ha_setup] crm_mon -1 -r


============
Last updated: Sun Dec 30 18:24:57 2007
Current DC: postgres-02 (211523e0-a549-49b7-bf29-f646915698ef)
2 Nodes configured.
4 Resources configured.
============

Node: postgres-02 (211523e0-a549-49b7-bf29-f646915698ef): online
Node: postgres-01 (24a3fa1b-6b62-470c-a6e1-4c1598875018): online

Full list of resources:

Master/Slave Set: ms-drbd0
    drbd0:0     (heartbeat::ocf:drbd):  Master postgres-01
    drbd0:1     (heartbeat::ocf:drbd):  Slave postgres-02
fs0     (heartbeat::ocf:Filesystem):    Stopped
ip0     (heartbeat::ocf:IPaddr2):       Stopped
pgsql0  (heartbeat::ocf:pgsql): Stopped


As you can see everything is stopped but linux-ha doesn't move all the stuff
over (which would be neccessary). I think I miss a colocation or order
constraight but I thought it would be clear to Linux-Ha because it
should already be able to build the graph:

Order:

drbd0(MASTER) _PROMOTE_ FS0 (btw. why is on the tutorial a promote instead of a 
BEFORE order? Is it because of the master thing?)
FS0 _BEFORE_ PGSQL
IP0 _BEFORE_ PGSQL

Colocation:

05_colocation_drbd_master_on_fs0
10_colocation_pgsql_ip0
11_colocation_pgsql_fs0
12_colocation_fs0_ip0

I use about the same setup. But I tied the filesystem, ip and postgres (and slon) into a group and this works great. If you want my config, send me a PM.

Regards
Dominik
_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to