[pgpool-general: 1260] Re: Master-slave mode with 2 primary servers problem
anzai at sraoss.co.jp
Thu Dec 20 11:47:56 JST 2012
> I'm afraid I don't have the logs from the time of the problem.
> What I have attached, is the logs from pgpool on startup.
> There is nothing in Postgres logs when we stop/start pgpool.
> What I tried so far, was to restart the Postgres servers and then PGPool, to remove the second backend from configuration and add it back, to touch the trigger files.
> I also did try to reset the recovery.conf files on both servers.
> Finally, I tried to dump the pgpool_status file.
Could you try the following steps to revert the initial setup?
# You don't want the previous standby node to work as primary/master, and
# now want to switch them, right?
1. Stop the previous primary node (it already stopped ?), and move $PGDATA
to another directory.
2. Do recovery of the previous primary node.
2-1. Get base backup from a node which became primary by failover.
2-2. Copy the base backup to primary $PGDATA.
2-3. Put recovery.conf to primary $PGDATA and start.
2-4. Wait recoverying of primary until you see "streaming replication
successfully connected to primary" in the log.
3. Put trigger file and make the previous primary node primary without
4. Do pcp_attach_node & pcp_promote_node and make this primary node is the
master node of pgpool.
5. Stop the previous master node, and do step 2 to make standby node.
And do pcp_attach_node to be as a slave node again.
> My main question is, how does PGPool know what server is running as a primary?
> Is there a flag in configuration or maybe is there something related to the Postgres server(s) that has been changed and I need to revert it back?
When pgpool tries find the new primary, which node is primary or standby
is judged by each result of "SELECT pg_is_in_recovery()". If false, the
node is primary.
> Thanks again for your time and effort.
> -----Original Message-----
> From: pgpool-general-bounces ¡÷ pgpool.net [mailto:pgpool-general-bounces ¡÷ pgpool.net] On Behalf Of Nozomi Anzai
> Sent: 18 December 2012 04:17
> To: pgpool-general ¡÷ pgpool.net
> Subject: [pgpool-general: 1258] Re: Master-slave mode with 2 primary servers problem
> > Hi,
> > I have attached both files to this email.
> > I just edited the ips in pgpool.conf.
> > I'm sure that /mnt/host_$new_master/ folders are accessible to pgpool and the failover script, and that I can touch the trigger files for both servers.
> I confirmed your failover script worked without any problem.
> Could you show us pgpool's log and each PostgreSQL's logs at that time, too?
> And, what was the way you try to revert to the initial setup? Online recovery, reinitting and starting the standby manually, and so on.
> > Thank you for your time so far.
> > Regards,
> > Stelios
> > -----Original Message-----
> > From: pgpool-general-bounces ¡÷ pgpool.net
> > [mailto:pgpool-general-bounces ¡÷ pgpool.net] On Behalf Of Nozomi Anzai
> > Sent: 13 December 2012 01:38
> > To: pgpool-general ¡÷ pgpool.net
> > Subject: [pgpool-general: 1256] Re: Master-slave mode with 2 primary
> > servers problem
> > > Hi everyone,
> > >
> > > We have successfully installed a pgpool II setup with 2 postgres
> > > servers, one running as a primary and a second running as a slave.
> > > While running some tests on the behaviour of our application during
> > > failover, we ended up having both servers running as primary ones.
> > > We used the failover script to automate the procedure, and now we
> > > can't revert back to initial setup.
> > > We're not sure what we need to do so the second server become slave
> > > again.
> > I think your pgpool.conf or failover command have something wrong.
> > Could you show us them?
> > > Any help on that would be much appreciated.
> > >
> > > Regards,
> > > Stelios
> > >
> > --
> > Nozomi Anzai
> > SRA OSS, Inc. Japan
> > _______________________________________________
> > pgpool-general mailing list
> > pgpool-general ¡÷ pgpool.net
> > http://www.pgpool.net/mailman/listinfo/pgpool-general
> Nozomi Anzai
> SRA OSS, Inc. Japan
> pgpool-general mailing list
> pgpool-general ¡÷ pgpool.net
SRA OSS, Inc. Japan
More information about the pgpool-general