[ClusterLabs] No node name in corosync-cmapctl output

Jan Friesse jfriesse at redhat.com
Tue May 31 11:51:53 EDT 2022


On 31/05/2022 16:11, Ken Gaillot wrote:
> On Tue, 2022-05-31 at 13:16 +0000, 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.
> 
> The default is Pacemaker's; corosync doesn't actually know or care
> about the node name other than that the user added a configuration
> value for "name" (or not).

Just a bit correction.

What you've told was 100% true for corosync 1 and 2, but is not really 
case for corosync 3.x. Name, if defined, is used for matching local node 
even for corosync itself. There is actually a bit scary code taken from 
cman which tries to remove dot separated parts of full uname to match 
name. If name is not set or no match is found, ring0_addr is used instead.

This improvement was required to support configurations, where 
ring0_addr is not set ... what is valid corosync 3 configuration.

Regards,
   Honza

> 
> The equivalent query in Pacemaker would be "crm_node --name" (to get
> the local host's node name in the cluster) or "crm_node --list" (to
> show all known node names).
> 
>>
>>
>> I formed a test cluster of 3 nodes, and I'm not setting the name
>> attribute in the nodelist, so that it defaults to `uname -n`:
>> nodelist {
>>      node {
>>           nodeid: 1
>>          ring0_addr: k1
>>      }
>>      node {
>>          nodeid: 2
>>          ring0_addr: k2
>>      }
>>      node {
>>          nodeid: 3
>>          ring0_addr: k3
>>      }
>> }
>>
>> The addresses "k1", "k2" and "k3" are fully resolvable (I know IPs
>> are
>> better, but for this quick test it was simpler to use the hostnames).
>>
>> crm status is happy:
>> root at k1:~# crm status
>> Cluster Summary:
>>    * Stack: corosync
>>    * Current DC: k3 (version 2.1.2-ada5c3b36e2) - partition with
>> quorum
>>    * Last updated: Tue May 31 12:53:02 2022
>>    * Last change:  Tue May 31 12:51:55 2022 by hacluster via crmd on
>> k3
>>    * 3 nodes configured
>>    * 0 resource instances configured
>>
>> Node List:
>>    * Online: [ k1 k2 k3 ]
>>
>> Full List of Resources:
>>    * No resources
>>
>>
>> But there is no node name in the corosync-cmapctl output:
>>
>> root at k1:~# corosync-cmapctl |grep nodelist
>> nodelist.local_node_pos (u32) = 0
>> nodelist.node.0.nodeid (u32) = 1
>> nodelist.node.0.ring0_addr (str) = k1
>> nodelist.node.1.nodeid (u32) = 2
>> nodelist.node.1.ring0_addr (str) = k2
>> nodelist.node.2.nodeid (u32) = 3
>> nodelist.node.2.ring0_addr (str) = k3
>>
>> I was expecting to have entries like "nodelist.node.0.name = k1" in
>> that output. Apparently I only get that if I explicitly set a node
>> name in nodelist.
>>
>> For example, if I set the name of nodeid 1 to "explicit1":
>>      node {
>>          name: explicit1
>>          nodeid: 1
>>          ring0_addr: k1
>>      }
>>
>> Then I get the name attribute for that nodeid only:
>> # corosync-cmapctl |grep nodelist
>> nodelist.local_node_pos (u32) = 0
>> nodelist.node.0.name (str) = explicit1
>> nodelist.node.0.nodeid (u32) = 1
>> nodelist.node.0.ring0_addr (str) = k1
>> nodelist.node.1.nodeid (u32) = 2
>> nodelist.node.1.ring0_addr (str) = k2
>> nodelist.node.2.nodeid (u32) = 3
>> nodelist.node.2.ring0_addr (str) = k3
>>
>> Why not also use "uname -n" when "name" is not explicitly set in the
>> corosync nodelist config?
>> _______________________________________________
>> Manage your subscription:
>> https://lists.clusterlabs.org/mailman/listinfo/users
>>
>> ClusterLabs home: https://www.clusterlabs.org/
>>



More information about the Users mailing list