Well, it was not working for me because I had not set health_check_period to some non zero value. When I set this to "4", it works fine. Failover is successful. Thanks for your help. BTW, what is good value for "health_check_period" ?
________________________________ From: "[email protected]" <[email protected]> To: Armin Nesiren <[email protected]> Cc: [email protected]; [email protected]; Tatsuo Ishii <[email protected]> Sent: Sat, January 29, 2011 3:30:18 AM Subject: RE: RE: [Pgpool-general] replication/failover feature in Master/Slavemode Try running pgpool -d -n, and search for “failover_command”. It should tell you if was or not executed. Remember to enable health_check in pgpool.conf. Search for “health_check” param in pgpool.conf. -Daniel From:Armin Nesiren [mailto:[email protected]] Sent: Friday, January 28, 2011 4:01 PM To: Crespo, Daniel @ SSG - SDS Cc: [email protected]; [email protected]; Tatsuo Ishii Subject: Re: RE: [Pgpool-general] replication/failover feature in Master/Slavemode In my case there is no missunderstunding... Again... when I try to recover my old primary node (node 0) failover_command is not executed at all. I'm testing it just like you have described...im trying to echo string in file that is located in /tmp On 28 Jan 2011 21:55, <[email protected]> wrote: > I think there is a misunderstanding... > > To clarify (just in case). > > 1. Pgpool detects non-healthy postgresql backend. > 2. Pgpool executes WHATEVER is in "failover_command" entry in > pgpool.conf > 3. The end. > > In "failover_command" you can put > "executeFailoverOfMyCurrentSlavePostgreSqlBackend.sh". > Which means, in yout pgpool.conf you should have: > failover_command="/path/to/executeFailoverOfMyCurrentSlavePostgreSqlBack > end.sh" > > in which you should do something like: > > +++++++++++++++++ > #!/bin/bash > > touch /path/to/where/trigger/file/must/exist > > +++++++++++++++++ > > Of course, you'll want to touch the trigger file of the backend that is > the standby, so you got to know its path. If you don't know it, let us > know. > > You might want to try having failover_command execute something that > writes to /tmp/somefile to prove that pgpool is actually executing > failover_command. > > Best regards, > -Daniel > >> -----Original Message----- >> From: Tatsuo Ishii [mailto:[email protected]] >> Sent: Friday, January 28, 2011 9:21 AM >> To: [email protected] >> Cc: [email protected]; [email protected]; Crespo, Daniel @ SSG - >> SDS; [email protected] >> Subject: Re: [Pgpool-general] replication/failover feature in >> Master/Slavemode >> >> > Also I have same problem. >> > When I do pcp_recovery of my old primary node (node 0), >> failover_command is >> > not executed, >> >> If you are using 3.0.x, then it's a known problem. >> Please try CVS HEAD (to be released as 3.1). >> -- >> Tatsuo Ishii >> SRA OSS, Inc. Japan >> English: http://www.sraoss.co.jp/index_en.php >> Japanese: http://www.sraoss.co.jp >> >> > I have set failback_command, and that command creates trigger file >> for me. >> > >> > This configuration works fine right now, but I would like to know if >> this is >> > right way to do it? >> > >> > On Fri, Jan 28, 2011 at 12:53 PM, Sandeep Thakkar >> <[email protected]>wrote: >> > >> >> Well, that's what my first question was. Why pgpool is not > executing >> the >> >> failover_command in my case? Does it need any more settings in >> pgpool.conf? >> >> I did not set failback_command. >> >> >> >> >> >> >> >> ------------------------------ >> >> *From:* Tatsuo Ishii <[email protected]> >> >> *To:* [email protected] >> >> *Cc:* [email protected]; [email protected]; >> >> [email protected] >> >> *Sent:* Fri, January 28, 2011 2:01:50 PM >> >> >> >> *Subject:* Re: [Pgpool-general] replication/failover feature in >> >> Master/Slavemode >> >> >> >> No. Failover_command will be automatically executed by pgpool-II if >> >> primary goes down. And you can have touch command to create the >> >> trigger file in your failover_command. This should automatically >> >> promote the standby. >> >> -- >> >> Tatsuo Ishii >> >> SRA OSS, Inc. Japan >> >> English: http://www.sraoss.co.jp/index_en.php >> >> Japanese: http://www.sraoss.co.jp >> >> >> >> > Thanks Tatsuo. So, does it mean with existing PG version (9.0), > we >> need >> >> to >> >> > manually execute failover script (create trigger file) even when >> using >> >> pgpool? >> >> > >> >> > >> >> > >> >> > >> >> > ________________________________ >> >> > From: Tatsuo Ishii <[email protected]> >> >> > To: [email protected] >> >> > Cc: [email protected]; [email protected]; >> >> > [email protected] >> >> > Sent: Fri, January 28, 2011 1:08:08 PM >> >> > Subject: Re: [Pgpool-general] replication/failover feature in >> >> Master/Slavemode >> >> > >> >> >> Yes, I'm aware that I need to create a trigger file (same as > what >> is >> >> defined in >> >> >> >> >> >> recovery.conf) to start the failover and promote the Standby to >> Primary. >> >> I have >> >> >> >> >> >> tried this when I did not use pgpool and it worked fine. I >> thought, when >> >> pgpool >> >> >> >> >> >> is in picture, it will execute the failver_command, when it >> detects that >> >> >> >> >>primary >> >> >> >> >> >> is down. and since, the failover_command in my case is to "touch >> trigger >> >> file". >> >> >> >> >> >> Shouldn't pgpool execute the failover_command here and create >> that file >> >> >> automatically? >> >> > >> >> > Besides the problem that it's not easy to read and parse >> >> > recovery.conf, creating trigger file might not be the only way to >> >> > promote standby server forever. Actually currently PostgreSQL >> >> > developers are discussing about "pg_ctl failover" command which >> will >> >> > be a new way to promote standby in the next version of >> >> > PostgreSQL. Pgpool-II is designed to be flexible to work with as >> many >> >> > PostgreSQL version as possible. So we don't want to hard code >> "touch >> >> > trigger file" in pgpool itself. >> >> > >> >> >> I think, either pgpool is not able to detect that primary is > down >> >> >> or it is unable to execute the failover_command. Am I missing to >> define >> >> >>anything >> >> >> >> >> >> in the configuration file? >> >> >> >> >> >> >> >> _______________________________________________ >> >> Pgpool-general mailing list >> >> [email protected] >> >> http://pgfoundry.org/mailman/listinfo/pgpool-general >> >> >> >> >> > >> > >> > -- >> > Armin
_______________________________________________ Pgpool-general mailing list [email protected] http://pgfoundry.org/mailman/listinfo/pgpool-general
