<div dir="ltr">Hi Team,<div><br></div><div>Thank you for the response. It was a mistake from our end, we had set jdbc url as (pgpool_ip,master_ip,slavei_p) so if pgpool and master goes down, it will start sending data to slave_ip. </div><div>This leads to problems in load balancing.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 20, 2020 at 5:50 AM Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">>  - I tried this option to stop and start pgpool but this affects load<br>
> balancing. We I use systemctl to stop and start pgpool, then write<br>
> statements are sent to primary only but when I use stopping and starting<br>
> with "pgpool stop -mf" and "pgpool -f pgpool.conf -D" respectively, pgpool<br>
> doesn't recognize write and sends to standby, this is resolved only after<br>
> restarting the application<br>
<br>
I am confused. How did you do when you say "I tried this option to<br>
stop and start pgpool"? Pgpool's stop option is nothing related to<br>
load balance.<br>
<br>
Anyway I suspect there's something wrong with the systemd setting for<br>
pgpool. Can you share /etc/sysconfig/pgpool?<br>
<br>
> Because systemd kill -9 pgpool to not give a chance to remove the socket<br>
> files.<br>
> - This should not be the case right, because in production there will be<br>
> connections all the time and after using systemctl these files should be<br>
> removed<br>
<br>
You can configure systemctl's parmeter for pgpool to shut down pgpool<br>
properly even if there are connections from clients. That's why I am<br>
asking /etc/sysconfig/pgpool.<br>
<br>
> Thanks and Regards,<br>
> Nikhil<br>
> <br>
> <br>
> On Fri, Jul 17, 2020 at 3:49 AM Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>> wrote:<br>
> <br>
>> First of all, you are asking questions about propriety<br>
>> packages. Please ask questions regarding propriety products to the<br>
>> vendor.<br>
>><br>
>> > Hi Team,<br>
>> ><br>
>> > I am testing pgpool for my workload.We have three nodes of pgpool used<br>
>> as a<br>
>> > load balancer and connection pooler across three nodes of database<br>
>> servers.<br>
>> ><br>
>> > All application connections to the database are through the pgpool.<br>
>> Without<br>
>> > stopping the application, if we want to stop the pgpool using "systemctl<br>
>> > stop edb-pgpool-4.0" then it takes a long time because connections are<br>
>> > still coming to the pgpool. Pgpool is stopped only after no new<br>
>> connections<br>
>> > appear + existing connections are terminated.<br>
>> ><br>
>> > Even after Pgpool is stopped, I can see that files(.s.PGSQL.9898 and<br>
>> > .s.PGSQL.9999) under socket_dir which in our case is /tmp are not<br>
>> removed.<br>
>> > This does not allow the pgpool to start using  "systemctl start<br>
>> > edb-pgpool-4.0". We have to manually remove the files under /tmp and then<br>
>> > start pgpool.<br>
>> ><br>
>> > I have two questions:<br>
>> > 1. Before stopping pgpool, how can we prevent new connections from coming<br>
>> > into pgpool without stopping the application and terminate the<br>
>> > existing connections so that the stop command does not wait.<br>
>><br>
>> As other people already pointed out, there's an option to stop pgpool<br>
>> without waiting for clients disconnected to pgpool. Probably you can<br>
>> set the option to tweak systemectl related files. The way to do it<br>
>> depends how the package is created, which we don't know. If you are<br>
>> not sure, ask the vendor.<br>
>><br>
>> > 2. After stopping pgpool, why are files under /tmp not removed?<br>
>><br>
>> Because systemd kill -9 pgpool to not give a chance to remove the<br>
>> socket files.<br>
>><br>
>> > PS:Files are removed from /tmp if there are no connections via<br>
>> pgpool(this<br>
>> > will never be the case in production environment)<br>
>><br>
>> Because if there's no connection from clients, pgpool can remove the<br>
>> socket files before systemd kills pgpool.<br>
>><br>
>> Best regards,<br>
>> --<br>
>> Tatsuo Ishii<br>
>> SRA OSS, Inc. Japan<br>
>> English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
>> Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
>><br>
</blockquote></div>