t-matsuo / resource-agents

pgsql RA(ocf resource agent) for Pacemaker and PostgreSQL streaming replication. See https://github.com/t-matsuo/resource-agents/wiki
https://github.com/t-matsuo/resource-agents/wiki
GNU General Public License v2.0
118 stars 11 forks source link

trouble detect master #25

Open greenx opened 11 years ago

greenx commented 11 years ago

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
t-matsuo commented 11 years ago

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. https://github.com/ClusterLabs/resource-agents/commit/78ddf466e413d0c1f18f7610cfbd63968b012ce0

greenx commented 11 years ago

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" :)

greenx commented 11 years ago

May be

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

And grep hostname ?

t-matsuo commented 11 years ago

It may be better than using crm_mon.

t-matsuo commented 11 years ago

Pacemaker 1.0.x needs instance number to use crm_resource.

# crm_resource --resource pgsql:0 --locate
greenx commented 11 years ago

Even in CentOS 1.1.7 :)

t-matsuo commented 11 years ago

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.