t-matsuo/resource-agents

trouble detect master

greenx opened this issue · 7 comments

Hi, again!

I test cluster on corosync 2.3.x.
So I had to build packages from source.
These: libqb, corosync, resource-agents, pacemaker.
And I saw the problems on the slave servers.
They are constantly searching for the master server.
I found in you code this string

crm_mon -n1 | tr -d "\t" | tr -d " " | grep "^pgsql:.*[):]Master"

But, in old version cluster crm_mon return this string

pgsql:0(ocf::heartbeat:pgsql):Master

And in new version:

pgsql(ocf::heartbeat:pgsql):Master

As long as I just took a colon in the regular expression.
I saw your conversation with "OCF_RESKEY_CRM_meta_notify_master_uname".
You did not kill this problem?

In any case, the version of packages installed from source.

# yum list installed libqb corosync resource-agents pacemaker
corosync.x86_64          2.3.0-1.21.298a.el6      @/corosync-2.3.0-1.21.298a.el6.x86_64
libqb.x86_64             0.14.4-1.38.07c9.el6     @/libqb-0.14.4-1.38.07c9.el6.x86_64
pacemaker.x86_64         1.1.10-1.el6             installed
resource-agents.x86_64   3.9.5-1.35.a645.el6      installed

Hi

OCF_RESKEY_CRM_meta_notify_master_uname is not set correctly.
so I use crm_mon reluctantly.
ref: https://developerbugs.linuxfoundation.org/show_bug.cgi?id=2607

You need this patch when using Pacemaker 1.1.10.
ClusterLabs@78ddf46

As far as I understand - these variables are set at the action "notify".
http://www.linux-ha.org/doc/dev-guides/_literal_notify_literal_action.html
But not yet understood how to use the "notify" :)

May be

# crm_resource --resource pgsql --locate
resource pgsql is running on: test-ins-db3 Master

And grep hostname ?

It may be better than using crm_mon.

Pacemaker 1.0.x needs instance number to use crm_resource.

# crm_resource --resource pgsql:0 --locate

Even in CentOS 1.1.7 :)

Yes, I know.
Pacemaker 1.0.x needs resource-agents, so we should retain compatibility.

If RA uses crm_resource command instead, it needs "for loop" to check all instance.
I think it's not so good.