[pgpool-general: 1262] Re: Master-slave mode with 2 primary servers problem

Tatsuo Ishii ishii at postgresql.org
Wed Dec 26 10:59:29 JST 2012


In my understanding, Nozomi has been waiting for response from Stelios Limnaios.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

> Hi,
> Sorry to interrupt. I'm also facing the same problem.
> Any progress with this?I'm curious to know whether this problem has been
> resolved or not.
> 
> On Thu, Dec 20, 2012 at 10:47 AM, Nozomi Anzai <anzai at sraoss.co.jp> wrote:
> 
>> > Hi,
>> >
>> > 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.
>>    ex.)http://www.pgpool.net/pgpool-web/contrib_docs/simple_sr_setting/
>>
>>    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
>>    recoverying again.
>>
>> 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.
>> >
>> > Regards,
>> > Stelios
>> >
>> >
>> > -----Original Message-----
>> > From: pgpool-general-bounces at pgpool.net [mailto:
>> pgpool-general-bounces at pgpool.net] On Behalf Of Nozomi Anzai
>> > Sent: 18 December 2012 04:17
>> > To: pgpool-general at 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.
>> >
>> > Thanks.
>> >
>> > > 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 at pgpool.net
>> > > [mailto:pgpool-general-bounces at pgpool.net] On Behalf Of Nozomi Anzai
>> > > Sent: 13 December 2012 01:38
>> > > To: pgpool-general at 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 at pgpool.net
>> > > http://www.pgpool.net/mailman/listinfo/pgpool-general
>> >
>> >
>> > --
>> > Nozomi Anzai
>> > SRA OSS, Inc. Japan
>> > _______________________________________________
>> > pgpool-general mailing list
>> > pgpool-general at pgpool.net
>> > http://www.pgpool.net/mailman/listinfo/pgpool-general
>>
>>
>> --
>> Nozomi Anzai
>> SRA OSS, Inc. Japan
>> _______________________________________________
>> pgpool-general mailing list
>> pgpool-general at pgpool.net
>> http://www.pgpool.net/mailman/listinfo/pgpool-general
>>


More information about the pgpool-general mailing list