<meta_attributes id="group_1_instance_attrs">
    <attributes>
        <nvpair id="group_1_target_role" name="target_role" value="started"/>
        <nvpair id="group_1_resource_stickiness" name="resource_stickiness" 
value="200"/>
    </attributes>
</meta_attributes>

And the score of 200 counts for every primitive in the group. Ok, so it's 800. 
I thought it counts only one time.

Again, read http://wiki.linux-ha.org/ScoreCalculation

Yes I read it. I have changed the resource stickiness to 50 (as you can see 
below), so I got 200 at the end for those four primitve declarations.


Apart from my misunderstanding here with 4*200 score, does my setup work 
score-wise now? Or do I miss anything?

I don't know the config you use "now", but if you address the score issue I 
pointed out, I guess it should. The cib looked ok.

Yes it works now, I tried several times.

But could you enlighten me please when to use instance_attributes and when to 
use meta_attributes or point me to a documentation about that. In fact there 
was no error shown when the group is defined like this:

                       <group id="group_1">
                               <primitive class="heartbeat" id="drbddisk_1" 
provider="heartbeat" type="drbddisk">
                                       <operations>
                                               <op id="drbddisk_1_mon" interval="30s" 
name="monitor" timeout="25s"/>
                                       </operations>
                                       <instance_attributes 
id="drbddisk_1_inst_attr">
                                               <attributes>
                                                       <nvpair id="drbddisk_1_attr_1" 
name="1" value="data1"/>
                                               </attributes>
                                       </instance_attributes>
                               </primitive>
                               <primitive class="ocf" id="Filesystem_1" provider="heartbeat" 
type="Filesystem">
                                       <operations>
                                               <op id="Filesystem_1_mon" interval="30s" 
name="monitor" timeout="25s"/>
                                       </operations>
                                       <instance_attributes 
id="Filesystem_1_inst_attr">
                                               <attributes>
                                                       <nvpair id="Filesystem_1_attr_0" 
name="device" value="/dev/drbd0"/>
                                                       <nvpair id="Filesystem_1_attr_1" 
name="directory" value="/data1"/>
                                                       <nvpair id="Filesystem_1_attr_2" 
name="fstype" value="ext3"/>
                                               </attributes>
                                       </instance_attributes>
                               </primitive>
                               <primitive class="ocf" id="mysql_1" 
provider="interactivedata" type="mysql">
                                       <operations>
                                               <op id="mysql_1_mon" interval="60s" 
name="monitor" timeout="55s"/>
                                       </operations>
                                       <instance_attributes 
id="mysql_1_inst_attr">
                                               <attributes>
                                                       <nvpair id="mysql_1_attr_0" 
name="test_table" value="heartbeat.test"/>
                                                       <nvpair id="mysql_1_attr_1" 
name="test_user" value="heartbeat"/>
                                                       <nvpair id="mysql_1_attr_2" 
name="test_passwd" value="test"/>
                                                       <nvpair id="mysql_1_attr_3" 
name="binary" value="/usr/bin/mysqld_safe"/>
                                                       <nvpair id="mysql_1_attr_4" 
name="pid" value="/var/run/mysqld/mysqld.pid"/>
                                                       <nvpair id="mysql_1_attr_5" 
name="OCF_CHECK_LEVEL" value="10"/>
                                               </attributes>
                                       </instance_attributes>
                               </primitive>
                               <primitive class="ocf" id="apache2_1" provider="heartbeat" 
type="apache">
                                       <operations>
                                               <op id="apache2_1_mon" interval="60s" 
name="monitor" timeout="55s"/>
                                       </operations>
                                       <instance_attributes 
id="apache_2_1_inst_attr">
                                               <attributes>
                                                       <nvpair id="apache_2_1_attr_0" 
name="configfile" value="/etc/httpd/conf/httpd.conf"/>
                                                       <nvpair id="apache_2_1_attr_1" 
name="statusurl" value="http://127.0.0.1/server-status/"/>
                                                       <nvpair id="apache_2_1_attr_2" 
name="options" value="-DSSL"/>
                                               </attributes>
                                       </instance_attributes>
                               </primitive>
                               <instance_attributes id="group_1_instance_attrs">
                                       <attributes>
                                               <nvpair id="group_1_target_role" 
name="target_role" value="started"/>
                                               <nvpair id="group_1_resource_stickiness" 
name="resource_stickiness" value="50"/>
                                       </attributes>
                               </instance_attributes>
                       </group>


Where and when is it better now to use instance_attributes and meta_attributes?

So far as I understood it from the documentation you pointed me to is:

instance attributes is used for options passed to the instance (e.g. the ocf 
script for apache).

meta attributes is used for options of the cluster_property_set (e.g. 
resource_stickiness).

In the file "crm.dtd" I find:


Most resource options are configured as instance attributes.
Some of the built-in options can be configured directly on the resource or as 
an instance attribute.
The advantage of using instance attributes is the added flexibility that can be 
achieved through conditional ?<rule/>s (see below).

You can have multiple sets of 'instance attributes', they are first sorted by 
score and then processed.
The first to have its ?<rule/> satisfied and define an attribute wins.
Subsequent values for the attribute will be ignored.

Note that:
* instance_attributes sets with id equal to cib-bootstrap-options are treated 
as if they have a score of INFINITY.
* instance_attributes sets with no score implicitly have a score of zero.
* instance_attributes sets with no rule implicitly have a rule that evaluates 
to true.

The addition of conditional <rule/>s to the instance_attributes object allows 
for an infinite variety of configurations.
Just some of the possibilities are:
* Specify different resource parameters
  * depending on the node it is allocated to (a resource may need to use eth1 
on host1 but eth0 on host2)
  * depending on the time of day (run 10 web-servers at night an 100 during the 
day)
* Allow nodes to have different attributes depending on the time-of-day
  * Set resource_stickiness to avoid failback during business hours but allow 
resources to be moved to a more preferred node on the weekend
  * Switch a node between a "front-end" processing group during the day to a 
"back-end" group at night.

Common instance attributes for all resource types:
* priority (integer, default=0):
  dictates the order in which resources will be processed.
  If there is an insufficient number of nodes to run all resources, the lower 
priority resources will be stopped to make sure the higher priority resources 
remain active.

* is_managed: See previous description.

* resource_stickiness: See previous description.

* target_role: (Started|Stopped|Master|Slave|default, default=#default)
  * #default : Let the cluster decide what to do with the resource
  * Started : Ignore any specified value of is_managed or is_managed_default 
and attempt to start the resource
  * Stopped : Ignore any specified value of is_managed or is_managed_default 
and attempt to stop the resource
  * Master : Ignore any specified value of is_managed, is_managed_default or 
promotion preferences and attempt to put all instances of a cloned resource 
into Master mode.
  * Slave : Ignore any specified value of is_managed, is_managed_default or 
promotion preferences and attempt to put all instances of a cloned resource 
into Slave mode.

Common instance attributes for clones:
* clone_max (integer, default=1):
  the number of clones to be run

* clone_node_max (integer, default=1):
 the maximum number of clones to be run on a single node

Common instance attributes for nodes:
* standby (boolean, default=FALSE)
  if TRUE, indicates that resources can not be run on the node
-->
<!ELEMENT instance_attributes (rule*, attributes)>
<!ATTLIST instance_attributes
         id                CDATA        #REQUIRED
         score             CDATA        #IMPLIED>

<!ELEMENT meta_attributes (rule*, attributes)>
<!ATTLIST meta_attributes
         id                CDATA        #REQUIRED
         score             CDATA        #IMPLIED>



But when to use now instance or meta attributes?


Kind regards,

Achim

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to