<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi, just a follow-up to say that we implemented the configuration with 4 instances of pgpool-II on every node.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">So for every pgpool instance on every node we have to differentiate the following set of files:</div><div class="gmail_default" style="font-size:small">    1. /etc/pgpool-II/pgpool_00X.conf<br>    2. /etc/pgpool-II/failover_00X.sh<br>    3. /etc/pgpool-II/follow_primary_00X.sh<br>    4. /etc/pgpool-II/escalation_00X.conf<br>    5. /etc/pgpool-II/pool_passwd_00X</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The only file that cannot be differentiated is the pool_hba.conf which must be the same for all of the instances, there is no configuration option for it.<br></div><div class="gmail_default" style="font-size:small">One side effect is that there is a significant sprawl of processes on the servers. If you consider pgpool and postgres processes, we are at about 1200 processes on every node, but they are physical servers with a lot of cores.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The benefit of this articulated configuration is that every pgpool cluster is managed by 3 nodes so there are less chances of split brain and you can leverage the fact that the Primary pgpool process can be spread on different nodes.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks</div><div class="gmail_default" style="font-size:small">Luca</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 28, 2021 at 12:14 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">Hi,<br>
<br>
> Hi Tatsuo,<br>
> in your proposed schema, how do you manage the failover for example of C1<br>
> C2 C3 instances if you have only 1 instance on node2?<br>
<br>
>> On node 2 pgpool3 is running and managing C1, C2, C3<br>
<br>
Pgpool3 checks healthiness of C1, C2 and C3. If it notices C1<br>
(primary) goes down, detach C1 and promotes C2 or C3.<br>
<br>
> Thanks<br>
> Luca<br>
> <br>
> <br>
> On Tue, Jul 27, 2021 at 2:50 AM Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>> wrote:<br>
> <br>
>> > Hi Tatsuo, thank you for your feedback.<br>
>> ><br>
>> > The main requirement is to separate the 4 PG instances on every node,<br>
>> > mainly for performance and management reasons.<br>
>> ><br>
>> > So it seems that the only solution is to have 4 pgpool instances for<br>
>> every<br>
>> > node, right?<br>
>><br>
>> No. For example, you could have following configuration. (I suppose<br>
>> there are 3 physical servers = nodes). Here,<br>
>> An (n=1, 2, 3) represents "prod",<br>
>> Bn (n=1, 2, 3) represents "pre-production",<br>
>> Cn (n=1, 2, 3) represents "test", and<br>
>> Dn (n=1, 2, 3) represents "dev".<br>
>><br>
>> On node 1 following PostgreSQL instances are running.<br>
>> A1, B1, C1, D1<br>
>><br>
>> On node 2 following PostgreSQL instances are running.<br>
>> A2, B2, C2, D2<br>
>><br>
>> On node 3 following PostgreSQL instances are running.<br>
>> A3, B3, C3, D3<br>
>><br>
>> On node 1 pgpool1 is running and managing A1, A2, A3<br>
>> On node 1 pgpool2 is running and managing B1, B2, B3<br>
>> On node 2 pgpool3 is running and managing C1, C2, C3<br>
>> On node 3 pgpool4 is running and managing D1, D2, D3<br>
>><br>
>> Please note that on node 1 there are 2 pgpool instances, while on node<br>
>> 2 and 3 there is only 1 pgpool instance.<br>
>><br>
>> > Thanks<br>
>> > Best regards<br>
>> > Luca<br>
>> ><br>
>> ><br>
>> ><br>
>> > On Mon, Jul 26, 2021 at 3:56 AM Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>> wrote:<br>
>> ><br>
>> >> > Hello,<br>
>> >> ><br>
>> >> > we are setting up a 3 nodes clusters similar to this one:<br>
>> >> ><br>
>> >> > <a href="https://www.pgpool.net/docs/latest/en/html/example-cluster.html" rel="noreferrer" target="_blank">https://www.pgpool.net/docs/latest/en/html/example-cluster.html</a><br>
>> >> ><br>
>> >> > we are using CentOS 7.9 physical nodes with PGPool 4.2 and PostgreSQL<br>
>> 12.<br>
>> >> ><br>
>> >> > We need to have on every node 4 PostgreSQL instances (1 for prod, 1<br>
>> for<br>
>> >> > pre-production, 1 for test and 1 for dev), all of them must be in<br>
>> >> streaming<br>
>> >> > replication with the other 2 nodes.<br>
>> >> ><br>
>> >> > Can PGPool manage such configuration? From the documentation we didn't<br>
>> >> find<br>
>> >> > any reference.<br>
>> >> > We are thinking to create 4 different pgpool instances, each one with<br>
>> its<br>
>> >> > set of files and tcp port, is this a supported configuration?<br>
>> >><br>
>> >> The short answer is no.<br>
>> >><br>
>> >> Pgpool-II assumes that there's only one streaming replication primary<br>
>> >> server exists among PostgreSQL instances. That means:<br>
>> >><br>
>> >> Suppose you have following PostgreSQL instances:<br>
>> >><br>
>> >> "A" group for "prod": A1, A2, A3<br>
>> >><br>
>> >> Pgpool-II can manage A1, A2 and A3, assuming that one of A1, A2,<br>
>> >> A3 is the primary server and rest of it are standby servers.<br>
>> >><br>
>> >> Similary:<br>
>> >> "B" group for "pre-production": B1, B2, B3<br>
>> >><br>
>> >> Pgpool-II can manage B1, B2 and B3, assuming that one of B1, B2,<br>
>> >> B3 is the primary server and rest of it are standby servers.<br>
>> >><br>
>> >> *BUT* a Pgpool-II instance cannot manage A group and B group altogeter<br>
>> >> at the same time.<br>
>> >><br>
>> >> So it seems you have 4 groups of PostgreSQL instances (prod,<br>
>> >> pre-production, test and dev), you can manage each group by assigning<br>
>> >> 4 Pgpool-II instances to each. In this case each Pgpool-II instance is<br>
>> >> completely separated and will not communicate each other. I am not<br>
>> >> sure what you can achieve in this configuration.<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>
>><br>
</blockquote></div>