<div dir="ltr">YES! it works!<div><br></div><div>i will install heartbear.... but i'm testing instalation and i take the easy way...</div><div>i let you know when i got it running</div><div><br></div><div>tks a lot!!</div>


</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 13, 2014 at 8:47 AM, Yugo Nagata <span dir="ltr"><<a href="mailto:nagata@sraoss.co.jp" target="_blank">nagata@sraoss.co.jp</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<div class=""><br>
On Wed, 12 Feb 2014 12:05:56 -0200<br>
Gonzalo Gil <<a href="mailto:gonxalo2000@gmail.com">gonxalo2000@gmail.com</a>> wrote:<br>
<br>
> i think it does not work...<br>
<br>
</div>I'm sorry for jumping to a wring conclusion. load_balance_mode is irrelevant.<br>
The problem is that, pgpool-II considers myself as down before failover is<br>
done completely. Before failover completed, pgpool-II's child process doesn't<br>
know the backend server is down, hence lifecheck query 'SELECT 1' fails, and<br>
pgpool-II consider itself in down status.<br>
<br>
To avoid this, health check should be done more frequently, or, lifecheck<br>
interval should be larger. In your configuration, health_check_max_retries = 3<br>
and helth_check_retry_delay = 10. So, it takes more than 30 seconds to detect<br>
backend DB's down and start failover. However, wd_interval = 5 and wd_life_point = 3.<br>
So, it is about 15 to 20 seconds before pgpool-II decide to go to down status.<br>
<br>
Could you please try edit pgpool.conf? For example:<br>
<br>
health_check_max_retries = 2<br>
health_check_retry_delay = 5<br>
wd_interval = 10<br>
wd_life_point = 3;<br>
<br>
In fact, I recommend to use heartbeat mode instead of query mode. This mode<br>
doesn't issue query like 'SELECT 1' for checking pgpool status. So, this avoids<br>
the kind of problem.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> <a href="http://172.16.62.141/status.php" target="_blank">http://172.16.62.141/status.php</a><br>
>          IP Address         Port         Status         Weight<br>
><br>
> node 0         tad1         5432         Up. Connected. Running as primary<br>
> server         postgres: Up         0.500                 |<br>
> node 1         tad2         5432         Up. Connected. Running as standby<br>
> server         postgres: Up         0.500                 |<br>
><br>
> <a href="http://172.16.62.142/status.php" target="_blank">http://172.16.62.142/status.php</a><br>
>          IP Address         Port         Status         Weight<br>
><br>
> node 0         tad1         5432         Up. Connected. Running as primary<br>
> server         postgres: Up         0.500                 |<br>
> node 1         tad2         5432         Up. Connected. Running as standby<br>
> server         postgres: Up         0.500                 |<br>
><br>
> shutdown  141, node0, tad1...<br>
><br>
><br>
><br>
> i attach logs....<br>
><br>
><br>
> this was the final result....<br>
> ---><br>
>          IP Address         Port         Status         Weight<br>
><br>
> node 0         tad1         5432         Down         postgres: Down<br>
>         0.500                 |<br>
> node 1         tad2         5432         Up. Connected. Running as standby<br>
> server         postgres: Up         0.500                 |<br>
> <---<br>
><br>
><br>
><br>
> On Wed, Feb 12, 2014 at 4:11 AM, Yugo Nagata <<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>> wrote:<br>
><br>
> > Hi,<br>
> ><br>
> > Thanks for sending confs & logs.<br>
> ><br>
> > I found that this problem occurs when load_balance_mode = off.<br>
> > Could you please try with load_balance_mode = on?<br>
> ><br>
> > I'll continue to analyze the detailed reason.<br>
> ><br>
> > On Mon, 10 Feb 2014 11:40:41 -0200<br>
> > Gonzalo Gil <<a href="mailto:gonxalo2000@gmail.com">gonxalo2000@gmail.com</a>> wrote:<br>
> ><br>
> > > i send the message but it was too long.<br>
> > > i'll attach the files....<br>
> > ><br>
> > > it happens again, even when node 2 was the postgres standby node.<br>
> > ><br>
> > > after i put the logs here, i shutdown node 1 (it has the primary<br>
> > database)<br>
> > > and it happens the same thing. node 2 lost ip and no failover happens.<br>
> > ><br>
> > ><br>
> > > TKS!<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > On Mon, Feb 10, 2014 at 5:23 AM, Yugo Nagata <<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>><br>
> > wrote:<br>
> > ><br>
> > > > Hi,<br>
> > > ><br>
> > > > This is odd that pgpool-1 losts VIP when server2 goes down. For<br>
> > analysis,<br>
> > > > could you please send pgpool.conf and log output (of both pgpool1 and<br>
> > > > pgpool2)?<br>
> > > ><br>
> > > > On Tue, 4 Feb 2014 13:38:16 -0200<br>
> > > > Gonzalo Gil <<a href="mailto:gonxalo2000@gmail.com">gonxalo2000@gmail.com</a>> wrote:<br>
> > > ><br>
> > > > > Hello Tatsuo Ishii. I send some query mails to<br>
> > > > > pgpool-general@pgpool.netbut i don't get my own messagese. But i do<br>
> > > > > recieve other mails from the<br>
> > > > > forum.<br>
> > > > ><br>
> > > > > Can you answer me some questions or forward them to the forum!?<br>
> > > > ><br>
> > > > ><br>
> > > > > I'm runing pgpool with streaming replication: pgpool1 - db postgres1<br>
> > > > > (server 1) and pgpool2 - db postgres 2 (server 2).<br>
> > > > > I'm using watchdog with a virtual ip and life_check_query.<br>
> > > > ><br>
> > > > > It's all configured and working .... more or less....<br>
> > > > ><br>
> > > > > INIT: I start my system: postgres1 is standby database and postgres2<br>
> > > > > is master (streaming replication).<br>
> > > > > pgpool1 has the virtual ip.(and pgpool2 no, obviously)<br>
> > > > ><br>
> > > > > i connect to database via pgpool and everithing is ok.<br>
> > > > > i stop postgres1 and nothing happens because i check new_master <><br>
> > > > > old_master (no master failure).<br>
> > > > > i start postgres1 again (and returning it with pgpoolAdmin) or call a<br>
> > > > > recovery and it works great.<br>
> > > > ><br>
> > > > > I stop postgres2 and failover fires ... and i get postgres1 as the<br>
> > new<br>
> > > > > primary.<br>
> > > > > and so on...<br>
> > > > ><br>
> > > > > this works fine.<br>
> > > > ><br>
> > > > ><br>
> > > > > i go back to INIT again....<br>
> > > > > and i do in server2<br>
> > > > > reboot -h now<br>
> > > > ><br>
> > > > > i see in the server1 (pgpool1) log that pgpool2 is down...ok<br>
> > > > > watching the log, i see pgpool1 lost the virtual ip address<br>
> > (!?)....and<br>
> > > > > tell me to restart pgpool....(!?)<br>
> > > > ><br>
> > > > > i restart it and i see that failover fires ... but in the failover<br>
> > > > script i<br>
> > > > > get new_master_node = old_master_node ...and thus i do not make<br>
> > touch and<br>
> > > > > postgres1 keeps as a standby...<br>
> > > > ><br>
> > > > ><br>
> > > > > I change failover.sh (and the command in the pgpool.conf). i include<br>
> > all<br>
> > > > > parameters to see it's values when failover.sh start....<br>
> > > > ><br>
> > > > > Then, i restart serve2 and "return" database to pgpool....<br>
> > > > ><br>
> > > > > again, pgpool1 has the virtual ip.<br>
> > > > > i stop database in node 2 and failover fires.... but pgpool2 does<br>
> > > > it....and<br>
> > > > > pgpool1 too (!?)<br>
> > > > > i check network activity and saw that pgpool2 connects to server1 and<br>
> > > > make<br>
> > > > > the touch and i did see log from pgpool1 firing the failover command<br>
> > > > too....<br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> > > > > Cuestions....<br>
> > > > > 1. why pgpool1 lost virtual ip and ask me to restart!?<br>
> > > > > 2. why pgpool2 fires failover? i thought just the "primary" pgpool<br>
> > (the<br>
> > > > one<br>
> > > > > with the virtual ip) fires it.<br>
> > > > ><br>
> > > > ><br>
> > > > > i hope you understand mr.<br>
> > > > > tks a lot for your time..<br>
> > > > > sorry for my english.<br>
> > > ><br>
> > > ><br>
> > > > --<br>
> > > > Yugo Nagata <<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>><br>
> > > ><br>
> ><br>
> ><br>
> > --<br>
> > Yugo Nagata <<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>><br>
> ><br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Yugo Nagata <<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>><br>
</font></span></blockquote></div><br></div>