[ClusterLabs] 2-node cluster Postgresql problem with lock file
Damien Bras
damien.bras at homesend.com
Thu Nov 12 08:54:15 UTC 2015
Hi,
I have a 2-node cluster using PostgreSQL synchronous streaming replication. I don't have preference of the location of the master role.
I followed this documentation : http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster, and it the replication works great.
I just have a question about the PGSQL.lock file.
When the master crashes (node A), the resources switches on the hot standby slave (node B), it's OK. I can create record on the DB of node B.
But when the old master restart (node A), I have an error "My data may be inconsistent" because there is the PGSQL.lock file on this node.
I don't understand why this file is not deleted on start when the master role is on another node of the cluster.
In my mind, I'd like it to work like that : When A crashes, Master role switches on the second node (B) and it has the last data because it's a synchronous replication. So it become the reference. So, when the node A restart, pacemaker put it on slave (hot standby), activate the replication and that's all. Later, if B crashes, master roles switches to A, etc ....
When I delete manually the PGSQL.lock, all works great : the slave synchronizes to the master.
Is there a way to do that automatically ? Is there a function in the pgsql RA where pacemaker can delete this lock file when the master role is already on another node in the cluster ?
Thanks in advance for your help.
Damien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20151112/d353803d/attachment-0003.html>
More information about the Users
mailing list