[ClusterLabs Developers] Trouble with crm_node -l output

Ken Gaillot kgaillot at redhat.com
Tue Nov 8 17:23:37 UTC 2016


On 11/08/2016 06:45 AM, Jehan-Guillaume de Rorthais wrote:
> Hi guys,
> 
> I am currently struggling with "crm_node --list" output. I need to get the list
> of existing nodes in the cluster from my resource agent ("past and current"
> nodes as stated in crm_node man page).
> 
> However, the "crm_node --list" output is quite different depending on the
> system you are running it on. It outputs either:
> 
>   * a single line with a simple list of node
>   * one pair of "NODEID NODENAME" per line
>   * one triplet of "NODEID NODENAME STATUS" per line

Unfortunately, there is no good answer here. The information presented
can vary by cluster layer (heartbeat vs corosync 1+CMAN vs corosync
1+plugin vs corosync 2), and the display format may have changed over
the years.

Currently, crm_node contacts the cluster layer directly. I'd like to
change that so that it contacts one of the pacemaker daemons instead,
which will allow for a more consistent view (and will allow remote nodes
to be counted). But that's long-term.

I think there are other resource agents, like galera IIRC, that need to
know the other nodes. You might want to see how they do it.

> Based on this, I am wondering how the db2 RA might work correctly on system not
> doing the "NODEID NODENAME STATUS" output. See:
> 
> https://github.com/ClusterLabs/resource-agents/blob/d304e3c7cd6dce010d63162341a612c0c654f0a3/heartbeat/db2#L263
> 
> Based on this,
>   * on what this output is based? 
>   * what can I test from my RA to know what kind of output I should expect?
>   * is there another way to get this list of node safely whatever
>     the version of <I don't know what produces this>?
> 
> Bellow the various output I gathered so far...(and maybe one bug using crm_node
> -N):
> 
> == CentOS 6.8
> 
> I have the following output:
> 
>   root at srv1:~$ crm_node -l
>   srv1 srv2 srv3
> 
> Packages and versions:
> 
>   cman                    3.0.12.1-78.el6.x86_64
>   corosync                1.4.7-5.el6.x86_64
>   corosynclib             1.4.7-5.el6.x86_64
>   libqb                   0.17.1-2.el6.x86_64
>   pacemaker               1.1.14-8.el6_8.1.x86_64
>   pacemaker-cli           1.1.14-8.el6_8.1.x86_64
>   pacemaker-cluster-libs  1.1.14-8.el6_8.1.x86_64
>   pacemaker-libs          1.1.14-8.el6_8.1.x86_64
> 
> == CentOS 7.2
> 
> I have the following output:
> 
>   root at srv1:~# crm_node -l
>   3 srv3 member
>   1 srv1 member
>   2 srv2 member
> 
> Packages and versions:
> 
>   corosync                2.3.4-7.el7_2.3.x86_64
>   corosynclib             2.3.4-7.el7_2.3.x86_64
>   libqb                   0.17.1-2.el7.1.x86_64
>   pacemaker               1.1.13-10.el7_2.4.x86_64
>   pacemaker-cli           1.1.13-10.el7_2.4.x86_64
>   pacemaker-cluster-libs  1.1.13-10.el7_2.4.x86_64
>   pacemaker-libs          1.1.13-10.el7_2.4.x86_64 
>   
> 
> 
> == Ubuntu 14.04
> 
> I have the following output:
> 
>   root at srv3:~# crm_node -l
>   3232266874 srv2
>   3232266875 srv3
>   3232266873 srv1
> 
> And BTW, crm_node is not able to get node name using node id: 
> 
>   root at srv3:~# crm_node -N 3232266875
>   (null)
>   root at srv3:~# crm_node -N 3232266874
>   (null)
>   root at srv3:~# crm_node -N 3232266873
>   (null)
> 
> 
> Packages and versions:
> 
>   corosync             2.3.3-1ubuntu3
>   libcorosync-common4  2.3.3-1ubuntu3
>   libqb0               0.16.0.real-1ubuntu5
>   pacemaker            1.1.10+git20130802-1ubuntu2.3
>   pacemaker-cli-utils  1.1.10+git20130802-1ubuntu2.3
> 
> == Debian 8
> 
> I have the following output:
> 
>   root at srv1:~# crm_node -l
>   3232266854 srv2 member
>   3232266853 srv1 member
>   3232266855 srv3 member
> 
> And same problem with "crm_node -N NODEID".
> 
> Packages and versions:
> 
>   corosync                       2.3.5-3~bpo8+1
>   libcorosync-common4            2.3.5-3~bpo8+1
>   libqb0                         0.17.2.real-4~bpo8+1
>   pacemaker                      1.1.14-2~bpo8+1
>   pacemaker-cli-utils            1.1.14-2~bpo8+1
>   pacemaker-common               1.1.14-2~bpo8+1
>   pacemaker-resource-agents      1.1.14-2~bpo8+1
> 
> 
> Thank you for your help!
> 
> Regards,




More information about the Developers mailing list