[ClusterLabs] Antw: Re: Q: Resource balancing opration

Ken Gaillot kgaillot at redhat.com
Thu Apr 21 10:53:50 EDT 2016


On 04/21/2016 01:56 AM, Ulrich Windl wrote:
>>>> Ken Gaillot <kgaillot at redhat.com> schrieb am 20.04.2016 um 16:44 in Nachricht
>> You can also use rules to make the process intelligent. For example, for
>> a server that provides office services, you could set a rule that sets
>> infinite stickiness during business hours, and small or zero stickiness
>> otherwise. That way, you'd get no disruptions when people are actually
>> using the service during the day, and at night, it would automatically
>> rebalance.
> 
> Could you give a concrete example for this?

Sure, looking at the example in:

http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-single/Pacemaker_Explained/index.html#_using_rules_to_control_cluster_options


Normally, the CIB's resource defaults section will have a single set of
meta-attributes:

  <rsc_defaults>

     <meta_attributes id="cluster-meta_attributes">
        <nvpair id="core-stickiness"
           name="resource-stickiness"
           value="INFINITY"/>
     </meta_attributes>

  </rsc_defaults>


If you have more than one, the cluster will use the one with the highest
score (in the example below, always the "core-hours" set with infinite
stickiness):

  <rsc_defaults>

     <meta_attributes id="core-hours" score="2">
        <nvpair id="core-stickiness"
           name="resource-stickiness"
           value="INFINITY"/>
     </meta_attributes>

     <meta_attributes id="after-hours" score="1">
        <nvpair id="after-stickiness"
           name="resource-stickiness"
           value="0"/>
     </meta_attributes>

  </rsc_defaults>

If you add a rule to a set, that set will only be considered when the
rule is true. So in this final result, we have infinite stickiness
during part of the day and no stickiness the rest of the time:

  <rsc_defaults>

     <meta_attributes id="core-hours" score="2">
        <rule id="core-hour-rule" score="0">
          <date_expression id="nine-to-five-Mon-to-Fri"
             operation="date_spec">
                <date_spec id="nine-to-five-Mon-to-Fri-spec"
                   hours="9-16" weekdays="1-5"/>
          </date_expression>
        </rule>
        <nvpair id="core-stickiness"
           name="resource-stickiness"
           value="INFINITY"/>
     </meta_attributes>

     <meta_attributes id="after-hours" score="1" >
        <nvpair id="after-stickiness"
           name="resource-stickiness"
           value="0"/>
     </meta_attributes>

  </rsc_defaults>


Higher-level tools may or may not provide a simpler interface; you may
have to dump, edit and push the XML.




More information about the Users mailing list