Search code examples
centoscentos7postgresql-9.3high-availabilitypacemaker

Could not map name UUID | Pacemaker | linux clustering


I have a Linux Cluster based on Pacemaker(v1.1.18-11) and corosync(v2.4.3-2) setup on Centos 7.2 It is a Two nodes setup with nodes= DBHA (master) and DBFAILOVER (slave)

I have a resource Postgresql9 which uses this Resource agent: pgsql with slight variation

I am using the standard documentation to setup Postgres replication : PgSQL_Replicated_Cluster

After doing all step for master it still was not becoming master. Following error was shown in /var/log/cluster/corosync.log

Could not map name=dbha to a UUID

After debugging for a bit I found out that following command returns above error: /usr/sbin/crm_attribute -l reboot -N "dbha" -n "Postgresql9-status" -v "STOP"

Where Nodename is calucated by:

NODENAME=$(ocf_local_nodename | tr '[A-Z]' '[a-z]')

where ocf_local_nodename() is from ocf-shellfuncs:

ocf_local_nodename() {
    # use crm_node -n for pacemaker > 1.1.8
    which pacemakerd > /dev/null 2>&1
    if [ $? -eq 0 ]; then
        local version=$(pacemakerd -$ | grep "Pacemaker .*" | awk '{ print $2 }')
        version=$(echo $version | awk -F- '{ print $1 }')
        ocf_version_cmp "$version" "1.1.8"
        if [ $? -eq 2 ]; then
            which crm_node > /dev/null 2>&1
            if [ $? -eq 0 ]; then
                crm_node -n
                return
            fi
        fi
    fi

    # otherwise use uname -n
    uname -n

}

I tried running both commands crm_node -n and uname -n on DBHA node both return following: DBHA

Also in cibadmin:

<nodes> <node id="2" uname="DBHA">...

When I Manually run crm_attribute command to set attribute it again returns the same error.

Here is the CIB: CIB

Please help

Thanks in advance

NOTE: We have multiple setups on different OS(CENTOS (6.5,6.7,7.2,7.5) Redhat(7.5). We never faced this problem before. Also, the Capital letter (or small letters) in node names never caused any problems before.


Solution

  • It turns out that, pacemaker change the logic getting node names in crm_attribute and left a bug while comparing node names.

    This is fixed (7618c29) in the newer version of the pacemaker. Updating to latest patch fixed it for me.