[Linux-HA] Trying to understand sets

Dejan Muhamedagic dejanmm at fastmail.fm
Tue Oct 5 06:34:25 MDT 2010


Hi,

On Fri, Oct 01, 2010 at 10:24:09AM +0200, RaSca wrote:
> Hi all,
> as discussed two days ago on IRC, since that the 1.0.9 version had some 
> problems with multistate resources and groups, I'm trying to make sets work.
> I started from this configuration:
> 
> group cluster cluster-fs cluster-jboss
> ms cluster-ms-r0 cluster-r0 \
> 	meta master-max="1" master-node-max="1" clone-max="2" 
> clone-node-max="1" notify="true"
> colocation cluster_on_cluster-r0 inf: cluster cluster-ms-r0:Master
> order cluster_after_cluster-r0 inf: cluster-ms-r0:promote cluster-fs:start
> 
> But, as i said, there's a bug in this version of Pacemaker, so the 
> solution is to treat every single resource. Thanks to the IRC guys match 
> and andreask I find out a solution using sets, in this way:
> 
> ms cluster-ms-r0 cluster-r0 \
> 	meta master-max="1" master-node-max="1" clone-max="2" 
> clone-node-max="1" notify="true"
> colocation cluster-fs_on_cluster-r0 inf: ( cluster-jboss ) ( cluster-fs 
> ) cluster-ms-r0:Master
> order cluster-fs_after_cluster-r0 inf: cluster-ms-r0:promote ( 
> cluster-fs:start ) ( cluster-jboss:start )
> 
> Everything works fine. But I have two questions:
> 
> 1) what's the difference between the declaration with sets that is over 
> there and this one:
> 
> ms cluster-ms-r0 cluster-r0 \
> 	meta master-max="1" master-node-max="1" clone-max="2" 
> clone-node-max="1" notify="true"
> colocation cluster-fs_on_cluster-r0 inf: cluster-jboss cluster-fs 
> cluster-ms-r0:Master
> order cluster-fs_after_cluster-r0 inf: cluster-ms-r0:promote 
> cluster-fs:start cluster-jboss:start

The difference is slight and we have to take a look at the XML.
The over-parenthesised  above produces a constraint with three
sets:

      <rsc_order id="o1" score="INFINITY">
        <resource_set action="promote" id="o1-0">
          <resource_ref id="cluster-ms-r0"/>
        </resource_set>
        <resource_set action="start" id="o1-1" sequential="false">
          <resource_ref id="cluster-fs"/>
        </resource_set>
        <resource_set action="start" id="o1-2" sequential="false">
          <resource_ref id="cluster-jboss"/>
        </resource_set>
      </rsc_order>

The latter one produces two sets and looks like this:

      <rsc_order id="o2" score="INFINITY">
        <resource_set action="promote" id="o2-0">
          <resource_ref id="cluster-ms-r0"/>
        </resource_set>
        <resource_set action="start" id="o2-1">
          <resource_ref id="cluster-fs"/>
          <resource_ref id="cluster-jboss"/>
        </resource_set>
      </rsc_order>

I guess that adjacent resource sets are ordered. Note that
sequential is true by default. So, it seems to me that they
should be interpreted in the same way.

BTW, the 1.1 code barks at both, saying that single resource sets
are not allowed. Andrew, how is it supposed to be generated?

> In this way the resources comes up all the same time?

No, they should be started/stopped in the given order. Or did I
misunderstand your question?

> Note: this does 
> not worked for me, of course.

How?

> 2) Using sets it is also possible to declare groups just for logical 
> purpose (and for the output of crm_mon), without using them in 
> colocation and order declaration?

Don't think so.

> Does the creation of a group make some 
> changes in the resources relations?

AFAIK, a group is a shortcut for a set of order and collocation
constraints.

Thanks,

Dejan

> Thanks a lot!
> 
> -- 
> RaSca
> Mia Mamma Usa Linux: Niente è impossibile da capire, se lo spieghi bene!
> rasca at miamammausalinux.org
> http://www.miamammausalinux.org
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems



More information about the Linux-HA mailing list