[Pacemaker] Query regarding a Trigger when a node gets online in cluster

Andrew Beekhof andrew at beekhof.net
Tue Aug 5 22:55:44 EDT 2014


On 4 Aug 2014, at 1:40 pm, Dharmesh <cutedharmesh at gmail.com> wrote:

> Hi,
> 
> I am trying to implement following Scenario :-
> 
> i am having a 2 node cluster. Both the nodes are having PostgreSQL as Database & database replication is on from primary PostgreSQL node to secondary PostgreSQL node. 
> 
> Test Scenario :-
> 
> In case my Primary node goes down (Powered off or network failure) then i need to promote the PostgreSQL on secondary to act as Master. This thing is achieved easily by creating a resource agent and executing PostgreSQL promote command inside that resource agent. but the problem is that i need to make PostgreSQL on other node(which is down now) as Standby so that replication can begin from master to standby. For this purpose i need to take the base backup of new primary PostgreSQL and put it on to the other node when that node comes up.

I think you want a master/slave resource: 
   http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html/Pacemaker_Explained/s-resource-multistate.html

When the failed node comes back up, postresSQL will get started in slave mode and begin syncing from the master.
At least that is my understanding of how the postgresSQL agent works.

> 
> Since i don't have any trigger which will let me know that the other node is up now so how will PostgreSQL on other node be configured as standby for this new master.
> 
> Regards,
> 
> 
> On Sat, Aug 2, 2014 at 6:53 AM, Andrew Beekhof <andrew at beekhof.net> wrote:
> 
> On 1 Aug 2014, at 8:18 pm, Dharmesh <cutedharmesh at gmail.com> wrote:
> 
> > Hi,
> >
> > I am stuck with a problem in my cluster setup.
> > I am having a 2 node Pacemaker/Heartbeat cluster. My requirement is to execute a shell script from the currently online node to the other node (via ssh) when it gets online in cluster. Is there any trigger that lets me know that other node in cluster is online ??
> 
> Not directly. What are you trying to achieve?
> 
> 
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
> 
> 
> 
> 
> -- 
> Dharmesh Kumar
> Research Engineer
> Center for Development of Telematics
> Mehrauli, New Delhi-110 030
> (M) : +91-8130535993
> 
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20140806/f9e4d068/attachment-0003.sig>


More information about the Pacemaker mailing list