3

I'm running two pacemaker clusters on the corosync stack on CentOS 7 with all packages up to date with the distro release/updates packages.

Both clusters shows no cluster name with the command pcs status: Like this:

Cluster name:
Last updated: Mon Nov  3 09:55:58 2014
Last change: Fri Oct 31 11:09:22 2014 via cibadmin on beaker
Stack: corosync
Current DC: scooter (2) - partition with quorum
Version: 1.1.10-32.el7_0.1-368c726
5 Nodes configured
21 Resources configured

There is a cluster_name: entry in the totem section of /etc/corosync/corosync.conf, but I can't find anything related to the cluster name in the pacemaker CIB.

The clusters were created with pcs cluster setup --name clustername node1 node2 node3 node4 node5 (with clustername being the intended name of the cluster).

The /etc/corosync/corosync.conf is world-readable, as well as the directories above it.

MattBianco
  • 587
  • 1
  • 6
  • 23

1 Answers1

3

In the sources of pcs-0.9.115-32.el7 the getClusterName function is implemented:

def getClusterName():
    if is_rhel6():
        try:
            dom = parse(settings.cluster_conf_file)
        except (IOError,xml.parsers.expat.ExpatError):
            return ""

        return dom.documentElement.getAttribute("name")
    else:
        try:
            f = open(settings.corosync_conf_file,'r')
        except IOError as e:
            return ""

        p = re.compile('cluster_name: *(.*)')
        for line in f:
            m = p.match(line)
            if m:
                return m.group(1)

    return ""

This function check for rhel6 to extract the cluster name from /etc/cluster/cluster.conf (attribute name) or in other case from /etc/corosync/corosync.conf.

The regular expression expected at least one space between cluster_name and name ('cluster_name: *(.*)') in corosync.conf file, maybe this is the problem.


def is_rhel6():
    try:
        issue = open('/etc/system-release').read()
    except IOError as e:
        return False

    if re.search(r'(Red Hat Enterprise Linux Server|CentOS|Scientific Linux) release 6\.', issue):
        return True
    else:
        return False

Check if exist file /etc/corosync/corosync.conf with the proper permissions. I think this bug can be relevant for you: https://bugzilla.redhat.com/show_bug.cgi?id=1094812 and https://bugzilla.redhat.com/show_bug.cgi?id=1029129

I hope this help.

Federico Sierra
  • 3,499
  • 1
  • 18
  • 24
  • Actually, the regular expression expects zero or more spaces between the colon and the cluster name. I've tested the regex on `/etc/corosync/corosync.conf` with `grep -E` and it does match. My pcs is indeed `pcs-0.9.115-32.el7.x86_64`, but I wonder what `is_rhel6()` actually returns. – MattBianco Nov 05 '14 at 07:40
  • @MattBianco I updated my answer with more info. – Federico Sierra Nov 05 '14 at 12:31