Hi,

On Mon, Apr 21, 2008 at 12:21:04PM +0200, Franck Ganachaud wrote:
> Quote :
> >BTW, why is that important
> >to you? If you want to run a group on certain node, why not just
> >set the location constraint. If you don't care where it runs...
> >what difference does it make then how the cluster decides on
> >resource locations.
>
> Well, some people I have to answer to like things to be predictible and 
> this is a question I'll have to answer to in a near future.
>
> To be back on subject, the choosen node in a constraint free context seems 
> to be depend on the order of the node, these heuristics get interesting.
> After a few tests, for a constraint free cluster, it seems that the order 
> in the CIB makes a difference (cleanning cib.xml.*, pengine archive 
> directory between each run) but I'd like to be sure.
>
> I'm still very interested in these heuristic for the v2.1.3, even if they 
> are subject to change.

Given a set of equally scored nodes, the cluster tries to
distribute resources so that they each manage a fair chunk of
load. Right now, the only metric used is the number of resources
active on a node (see the sort_node_weight function). It can be
quite unfair, because for example an Oracle database gets the
same weight as an IP address. Perhaps in the future the user
could assign weights to resources. Also, the actual load may
influence the decision too. There's also the SysInfo resource
agent which may be used to define location constraints. This is
still an area which needs more work and research.

Thanks,

Dejan

>
> Dejan Muhamedagic a ?crit :
>> Hi,
>>
>> On Mon, Apr 21, 2008 at 11:37:37AM +0200, Franck Ganachaud wrote:
>>   
>>> Thanks for your answer, Dejan.
>>>
>>> That's the "almost" part I can't figure out.
>>>
>>> It seems that from the little knowledge I have of coding science and the 
>>> source of heartbeat (ahem! yes I did it, I looked at the source), tell me 
>>> if I'm wrong, pengine picks up the first (index 0) in the allowed nodes 
>>> list but how is populated this list ?
>>>     
>>
>> Do you mean which nodes are elligible to run resources or the
>> order of the nodes? For the former, certain historical data plays
>> part, such as if a particular resource failed to start on that
>> node and similar. As for the order of nodes, the most important
>> factor is the score. For example, you can influence the score
>> using location constraints. If the scores are the same for a set
>> of nodes, then some heuristics are used, but those are not
>> documented and may change in future. BTW, why is that important
>> to you? If you want to run a group on certain node, why not just
>> set the location constraint. If you don't care where it runs...
>> what difference does it make then how the cluster decides on
>> resource locations.
>>
>> Thanks,
>>
>> Dejan
>>
>>
>>   
>>> *Extract from crm\pengine\native.c :
>>> [...]
>>> *    crm_debug_3("Choosing node for %s from %d candidates",
>>>            rsc->id, g_list_length(rsc->allowed_nodes));
>>>
>>>    if(rsc->allowed_nodes) {
>>>        rsc->allowed_nodes = g_list_sort(
>>>            rsc->allowed_nodes, sort_node_weight);
>>>     
>>
>> The clue is in sort_node_weight.
>>
>>   
>>>      *  nodes = rsc->allowed_nodes;
>>>        chosen = g_list_nth_data(nodes, 0);*
>>>    }
>>>       return native_assign_node(rsc, nodes, chosen);
>>> *[...]*
>>>
>>> Dejan Muhamedagic a ?crit :
>>>     
>>>> Hi,
>>>>
>>>> On Mon, Apr 21, 2008 at 09:31:49AM +0200, Franck Ganachaud wrote:
>>>>         
>>>>> Hello,
>>>>>
>>>>> I have a two nodes cluster (nodeA and nodeB) with a set of resources 
>>>>> linked together in a group. Nothing tricky.
>>>>>
>>>>> How hearbeat select which node will run the resources? I see lines like 
>>>>> this :
>>>>> "pengine: [12684]: info: native_assign_node: 2 nodes with equal score 
>>>>> (1) for running the listed resources (chose nodeB):"
>>>>>
>>>>> But I can't figure out a pattern... can anyone enlighten me?
>>>>>             
>>>> Since you didn't express a preference where to run the resources
>>>> using a location constraint, the cluster (pengine) picks one at
>>>> random (or almost random).
>>>>
>>>> Thanks,
>>>>
>>>> Dejan
>>>>
>>>>         
>>>>> Franck
>>>>> _______________________________________________
>>>>>
>>>>>     
>
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
_______________________________________________
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