[ClusterLabs] No node name in corosync-cmapctl output

Jan Friesse jfriesse at redhat.com
Wed Jun 1 06:17:53 EDT 2022

On 31/05/2022 16:28, Andreas Hasenack wrote:
> Hi,
> On Tue, May 31, 2022 at 1:35 PM Jan Friesse <jfriesse at redhat.com> wrote:
>> Hi,
>> On 31/05/2022 15:16, Andreas Hasenack wrote:
>>> Hi,
>>> corosync 3.1.6
>>> pacemaker 2.1.2
>>> crmsh 4.3.1
>>> TL;DR
>>> I only seem to get a "name" attribute in the "corosync-cmapctl | grep
>>> nodelist" output if I set an explicit name in corosync.conf's
>>> nodelist. If I rely on the default of "name will be uname -n if it's
>>> not set", I get nothing.
>> wondering where is problem? name is not set so it's not in cmap, what is
>> (mostly) 1:1 mapping of config file. So this is expected, not a bug.
> It was surprising to me, because the node clearly has a name (crm_node -n).
>>> Why not also use "uname -n" when "name" is not explicitly set in the
>>> corosync nodelist config?
>> Can you please share use case for this behavior? It shouldn't be be hard
>> to implement.
> The use case is a test script[1], which installs the package, starts
> the services, and then runs some quick checks. One of the tests is to
> check for the node name in "crm status" output, and for that it needs
> to discover the node name.

got it

> Sure, plenty of ways to achieve that. Set it in the config to a known
> name, or run "crm_node -n", or something else. The script is doing:
> POS="$(corosync-cmapctl -q -g nodelist.local_node_pos)"
> NODE="$(corosync-cmapctl -q -g nodelist.node.$POS.name)"

Ok, so you need only local node name - then why not to add
[ "$NODE" == " ] && NODE=`uname -n`

No matter what, implementing resolving of just local node name would be 
really easy - implementing it clusterwise would be super hard (on 
corosync level). On the other hand, I'm really not that keen to have 
filled just local node name + it creates bunch of other problems 
(default value during reload, ...).

> and I was surprised that there was no "name" entry. In this cluster
> stack, depending on which layer you ask,  you may get different
> answers :)

Yup, agree. Sometimes it's confusing :( But the test is really about 
`crm` so pacemaker level...


> 1. https://salsa.debian.org/ha-team/crmsh/-/blob/master/debian/tests/pacemaker-node-status.sh
> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
> ClusterLabs home: https://www.clusterlabs.org/

More information about the Users mailing list