On Mon, Apr 21, 2008 at 11:37 AM, Franck Ganachaud
<[EMAIL PROTECTED]> 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 ?

It depends on the order in which the nodes appear in the CIB's <nodes/> section.
In turn, that order is usually determined by the order the nodes
appeared in ha.cf (or the order they started in if autojoin was
specified).

But Dejan is right... if you really do prefer one node over another,
the only reliable way to do this is to make sure they have different
scores.

>
>  *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);
>      *  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