<div dir="ltr">That was gotcha - The port change worked.<div><br><div>The reason this got mixed up was that the tutorial never mentioned changing it to 9999, so I kept the 5433 default in pgpool.conf file</div><div><br></div><div>(all pgpool.conf.sample files have this value of 5433 - it is very easy to get confused when many values are used, I suppose the tutorial could do better in this area)</div><div><br></div><div> node_id | hostname | port | status | lb_weight |  role  | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change<br>---------+----------+------+--------+-----------+--------+------------+-------------------+-------------------+-------------------+------------------------+---------------------<br> 0       | server1  | 5432 | up     | 0.333333  | master | 0          | true              | 0                 |                   |                        | 2021-10-31 18:33:27<br> 1       | server2  | 5432 | up     | 0.333333  | slave  | 0          | false             | 0                 |                   |                        | 2021-10-31 18:33:27<br> 2       | server3  | 5432 | up     | 0.333333  | slave  | 0          | false             | 0                 |                   |                        | 2021-10-31 18:33:27<br></div></div><div><br></div><div>That should be it for now, thanks for sticking around so long and helping!</div><div><br></div><div>-Nirav</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 31, 2021 at 8:13 PM Luca Maranzano <<a href="mailto:liuk001@gmail.com">liuk001@gmail.com</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"><div dir="ltr"><div class="gmail_default" style="font-size:small">Nirav, you are using port 5433 for pggpool and that port *must match* this parameter:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><pre>other_pgpool_port0 = 9999<br><br></pre><pre>You are using different ports AFAIK and it cannot work this way<br></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 31, 2021 at 6:18 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" target="_blank">niravbhatt.cpp@gmail.com</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"><div dir="ltr">The example has 9999 value. <div><br></div><div><a href="https://www.pgpool.net/docs/41/en/html/example-cluster.html" target="_blank">https://www.pgpool.net/docs/41/en/html/example-cluster.html</a><br></div><div><br></div><div>The serverN is alias to servers in /etc/hosts file.</div><div><br></div><div>10.192.10.10 server1 <== I started this first, for it to be master (master.log - not full, only part)<br>10.192.11.20 server2 <== Started 2nd, failed soon<br>10.192.12.30 server3 <== Started last, its log is attached as other.log<br></div><div><br></div><div>I tried debug5 (thanks for that suggestion), and here are my logs on master (server1) and server3. </div><div><br></div><div>I saw that server3 tries connection attempt to server2 as well (which had pgpool2 failed already) - so that connection refuse message should be ignored.</div><div><br></div><div>-Nirav</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 31, 2021 at 6:39 PM Luca Maranzano <<a href="mailto:liuk001@gmail.com" target="_blank">liuk001@gmail.com</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"><div dir="ltr"><div class="gmail_default" style="font-size:small">I put the 3 conf file into kdiff, and I noticed this:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">pgpool port is set to 5433 (from default of 9999) but then here <br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><pre>other_pgpool_port0 = 9999<br></pre><pre>you are using a wrong port, it should be 5433<br></pre><pre>Besides: you need to put real hostname in place of "serverN" or use dns/hosts alias.<br></pre><pre>What are the hostname of the nodes and how is configured /etc/hosts?<br><br></pre><pre>Cheers<br></pre><pre><br></pre> </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 31, 2021 at 5:24 PM Luca Maranzano <<a href="mailto:liuk001@gmail.com" target="_blank">liuk001@gmail.com</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"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Nirav,</div><div class="gmail_default" style="font-size:small">from server2.log:</div><div class="gmail_default" style="font-size:small">2021-10-31 14:15:54: pid 7785: WARNING:  pool key file "/var/lib/postgresql/.pgpoolkey" has group or world acc></div><div class="gmail_default" style="font-size:small">you must set "chmod 600 /var/lib/postgresql/.pgpoolkey" on all servers<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Oct 31 14:15:54 ip-10-192-11-20 pgpool[7789]: 2021-10-31 14:15:54: pid 7789: FATAL:  Add to watchdog cluster request is rejected by node "server1:9000"<br>Oct 31 14:15:54 ip-10-192-11-20 pgpool[7789]: 2021-10-31 14:15:54: pid 7789: HINT:  check the watchdog configurations.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Log says that the watchdog request is rejected, so connection is OK but it's surely a misconfiguration problem.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Try to increase debug level and check logs again</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Cheers</div><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 31, 2021 at 3:30 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" target="_blank">niravbhatt.cpp@gmail.com</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"><div dir="ltr">Btw - I forgot to attach the 3 pgpool.conf files (4.1, so all 3 are different) I use on each server.<div><br></div><div>I am also attaching pgpool2 service log on server1 (primary, for which pgpool-primary.conf is there) and that on server2 (secondary, for which pgpool-secondary.conf is there)</div><div><div><br></div><div>Thanks</div></div><div>-Nirav</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 31, 2021 at 12:39 AM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" target="_blank">niravbhatt.cpp@gmail.com</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"><div dir="ltr">pool_key problem was only observed in detached mode i.e. pgpool -n option. <div>pgpool was unable to decrypt password key somehow.</div><div><br></div><div>It is not happening with systemctl start pgpool2. </div><div>(I do not know what's the difference though, and whether process invocation could provide any debug info)<br></div><div><br></div><div>I can't see any error in service logs when I start using systemctl. </div><div>So I assume things are good from password standpoint.</div><div><br></div><div>You are right - Routes in AWS enable routing to specific instance using virtual ip (attached to interface via runtime script - up cmd in this case)</div><div><br></div><div><a href="https://aws.amazon.com/blogs/apn/making-application-failover-seamless-by-failing-over-your-private-virtual-ip-across-availability-zones/" target="_blank">https://aws.amazon.com/blogs/apn/making-application-failover-seamless-by-failing-over-your-private-virtual-ip-across-availability-zones/</a></div><div><br></div><div>Regarding pgpool2, it's a pity though such a well documented, highly customized & fine grained tool can't operate after all the config, and it is not obvious to find the reason from the service logs.</div><div>(I have been on this now since more than 1.5 months, but cannot get it working - my limited knowledge of linux is also playing its part)</div><div><br></div><div>To see if any of my server config was wrong, lastly I even switched servers i.e started server2 process first (which became the master) and started server1 process later - which failed just like the earlier case while connecting to server2:9000</div><div><br></div><div>Will continue tomorrow about it.</div><div><br></div><div>Thanks all along,</div><div>-Nirav</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 30, 2021 at 11:51 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" target="_blank">niravbhatt.cpp@gmail.com</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"><div dir="ltr">3 subnets in 3 AWS Availability zones for redundancy. They still share the same network.<div>This is a perfectly valid use case. (I have read about it earlier).<br></div><div><br></div><div>There seems some pool_key problem on server1, which I am investigating now.</div><div><br></div><div>-Nirav</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 30, 2021 at 11:43 PM Luca Maranzano <<a href="mailto:liuk001@gmail.com" target="_blank">liuk001@gmail.com</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"><div dir="auto">How different? Are the 3 nodes on 3 separate networks? If yes why? </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il sab 30 ott 2021, 22:40 Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" target="_blank">niravbhatt.cpp@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">They are different, but everything including ssh copy and ping is working between them.<div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 30, 2021 at 11:31 PM Luca Maranzano <<a href="mailto:liuk001@gmail.com" rel="noreferrer" target="_blank">liuk001@gmail.com</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"><div dir="auto">What about the netmask of the network interface on 3 nodes? </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il sab 30 ott 2021, 22:26 Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" rel="noreferrer" target="_blank">niravbhatt.cpp@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Luca<div><br></div><div>Thanks for the response.<br><div><br></div><div>Those logs belonged to the case when I put same pgpool.conf on all 3 servers, based on your suggestion. </div><div>As I saw later, this should not be done for 4.1.</div><div>So we should probably discard that case.</div><div><br></div><div>With separate pgpool.conf file, it is logging the things I sent in earlier mail. (connection refused by server1:9000)</div><div><br></div><div>Plus:</div><div><br></div><div>server2:</div><div>LOG:  setting the local watchdog node name to "server2:5433 Linux ip-10-192-11-20"<br></div><div>LOG:  watchdog remote node:0 on server1:9000<br></div><div>LOG:  watchdog remote node:1 on server3:9000<br></div><div><br></div><div>server3:</div><div>LOG:  setting the local watchdog node name to "server3:5433 Linux ip-10-192-12-30"<br></div><div><div>LOG:  watchdog remote node:0 on server1:9000<br></div><div>LOG:  watchdog remote node:1 on server2:9000</div></div></div><div><br></div><div>Thanks,</div><div>-Nirav</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 30, 2021 at 11:01 PM Luca Maranzano <<a href="mailto:liuk001@gmail.com" rel="noreferrer noreferrer" target="_blank">liuk001@gmail.com</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"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Nirav,</div><div class="gmail_default" style="font-size:small">you're right, the node id is only from 4.2, sorry for my oversight, I thought it was valid for versione 4.X. It's really strange that there are still no 4.2 debian packages available for Debian and Ubuntu, 4.2 was released in 2020.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I took a look at the logs, I found strange this:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">server1: LOG:  setting the local node "server1:5433 Linux ip-10-192-10-10" as watchdog cluster master    (it seems ok)</div><div class="gmail_default" style="font-size:small">server2: LOG:  setting the local watchdog node name to "<b>server1:5433 </b>Linux ip-10-192-11-20"</div><div class="gmail_default" style="font-size:small">server3: LOG:  setting the local watchdog node name to "<b>server1:5433</b> Linux ip-10-192-12-30"</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">why server2 and server3 are referencing themselves as server1? <br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Besides that you should set the VIP on the same subnet of the servers, for example 10.192.11.100, not with an IP from a different subnet (20.20.20.20)</div><div class="gmail_default" style="font-size:small"></div><div class="gmail_default" style="font-size:small">I still have to understand how parameters must be differentiated in 4.1 if you cannot use the node id file.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I'll try to investigate later.</div><div class="gmail_default" style="font-size:small">Cheers,</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 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 Sat, Oct 30, 2021 at 7:43 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" rel="noreferrer noreferrer" target="_blank">niravbhatt.cpp@gmail.com</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"><div dir="ltr"><div>To reiterate, this pgpool2 4.1 setup.</div><div><br></div>1 - I have now restored my different pgpool.conf files on each server, as described in the link for 4.1:<div><a href="https://www.pgpool.net/docs/41/en/html/example-cluster.html" rel="noreferrer noreferrer" target="_blank">https://www.pgpool.net/docs/41/en/html/example-cluster.html</a><br></div><div><br></div><div>They are now no longer identical.</div><div><br></div><div>They only differ in </div><div>- wd_hostname (this server), </div><div>- heartbeat_destination0 & heartbeat_destination1 (other servers eg for server1, this is server2 and server3, and vice versa), </div><div>- other_pgpool_hostname0 & other_pgpool_hostname1 (again, other servers)</div><div><br></div><div>I also diffed other files under /etc/pgpool2 and postgres home, including password files, they are also same across the 3 servers.</div><div><br></div><div>2 - I restarted the servers just in case port change was not in the effect. </div><div>I also tried telnet and I could see connection going from server2 & server3 to server1 on 9000.</div><div>So port or connectivity isn't issue. <br></div><div><br></div><div>3 - The issue is: WD on server1 is refusing connection to server2 and server3 watchdogs on 9000.</div><div><br></div><div>On server2 and server3 log:</div><div><br></div><div>LOG:  watchdog node state changed from [DEAD] to [LOADING]</div><div>LOG:  new outbound connection to server1:9000<br>FATAL:  Add to watchdog cluster request is rejected by node "server1:9000"<br>HINT:  check the watchdog configurations.<br>LOG:  Watchdog is shutting down<br></div><div><br></div><div>while server1 log:</div><div><br></div><div>LOG:  new watchdog node connection is received from "<a href="http://10.192.11.20:23277" rel="noreferrer noreferrer" target="_blank">10.192.11.20:23277</a>" <-- server2<br></div><div>LOG:  new watchdog node connection is received from "<a href="http://10.192.12.30:16596" rel="noreferrer noreferrer" target="_blank">10.192.12.30:16596</a>" <-- server3<br></div><div><br></div><div>(nothing else about why it refused connection - just this thing above)</div><div><br></div><div>I believe that's enough debug info, if you could spot any problems, please let me know.</div><div><br></div><div>Thanks for the assistance so far,</div><div>-Nirav</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 30, 2021 at 7:24 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" rel="noreferrer noreferrer" target="_blank">niravbhatt.cpp@gmail.com</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"><div dir="ltr">I also suspect if following line is true for 4.1 setup:<div><br></div><div><i>From Pgpool-II 4.2, now all configuration parameters are identical on all hosts<br></i></div><div><br></div><div>-Nirav</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 30, 2021 at 7:22 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" rel="noreferrer noreferrer" target="_blank">niravbhatt.cpp@gmail.com</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"><div dir="ltr"><div dir="ltr">Hello<div><br></div><div>I am following this link, which is pgpool2 v4.1. </div><div><br></div><div><a href="https://www.pgpool.net/docs/41/en/html/example-cluster.html" rel="noreferrer noreferrer" target="_blank">https://www.pgpool.net/docs/41/en/html/example-cluster.html</a><br></div><div><br></div><div>On my Ubuntu setup also that is the latest I can get: <b>4.1.4-3.pgdg20.04+2</b></div><div><br></div><div>If you still insist, I will try to set it up, but I guess you are quoting from this link: </div><div><br></div><div><a href="https://www.pgpool.net/docs/latest/en/html/example-cluster.html#EXAMPLE-CLUSTER-PGPOOL-NODE-ID" rel="noreferrer noreferrer" target="_blank">https://www.pgpool.net/docs/latest/en/html/example-cluster.html#EXAMPLE-CLUSTER-PGPOOL-NODE-ID</a><br></div><div><br></div><div>It is a more recent version of pgpool2 than what I have.</div><div><br></div><div>-Nirav</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 30, 2021 at 7:03 PM Luca Maranzano <<a href="mailto:liuk001@gmail.com" rel="noreferrer noreferrer" target="_blank">liuk001@gmail.com</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"><div dir="ltr"><div style="font-size:small">Hello,</div><div style="font-size:small">I think that the pgpool_node_id file is mandatory since it is used by every server to identify itself in the cluster with its node id.</div><div style="font-size:small">Where is it documented that it is not necessary?<br></div><div style="font-size:small"><br></div><div style="font-size:small">Try to configure it</div><div style="font-size:small"><br></div><div style="font-size:small">HTH</div><div style="font-size:small">Regards</div><div style="font-size:small">Luca</div><div style="font-size:small"><br></div><div style="font-size:small"><br></div><div style="font-size:small"><br></div><div style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 30, 2021 at 5:42 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" rel="noreferrer noreferrer" target="_blank">niravbhatt.cpp@gmail.com</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"><div dir="ltr"><div>Hello</div><div>Sorry for the late answer.</div><div><br></div>I now made pgpool.conf identical on all 3 servers, then restarted postgresql and pgpool2 services.<div><br></div><div>I opened ports on each server: 22, 9999/tcp, 9898/tcp, 9000/tcp, 9694/udp, 5433, 5432</div><div><br><div>Yet the problem persists on server2 and server3 - it can not connect to 9000 port (on themselves)</div><div>Server1 pgpool seems to be running without problem.<div><br></div><div>I am attaching my pgpool.conf file. Also, I am attaching pgpool2 service logs from all 3 servers.</div><div><br></div><div>10.192.10.10 server1<br>10.192.11.20 server2<br>10.192.12.30 server3<br></div><div><br></div><div>Virtual IP is 20.20.20.20</div><div><br></div><div>I am running the following pgpool2 version so I do not think I need pgpool_node_id file.</div><div><br></div><div>4.1.4-3.pgdg20.04+2<br></div><div><br></div><div>Thanks for the support,</div><div>-Nirav</div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 27, 2021 at 8:48 AM Luca Maranzano <<a href="mailto:liuk001@gmail.com" rel="noreferrer noreferrer" target="_blank">liuk001@gmail.com</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"><div dir="ltr"><div style="font-size:small">Hi, still not clear to me, from the doc:</div><div style="font-size:small"><br></div><div style="font-size:small"><h2><a name="m_-1567035522465410037_m_598932675476204257_m_-8069582971293028957_m_8467763356914601085_m_-5438450845564371100_m_-5799137346731816880_m_45165496939637516_m_-1216160991438932093_m_7208307963297830829_m_891176574657771264_m_4830567342563357121_m_-7368801365795334074_m_-223356869521148085_m_5266789071049486177_m_2765504362854124774_m_7712759150699801061_m_1767960571698190553_m_-4340367351515201548_m_-36142555867749866_m_37919857654363922_EXAMPLE-CLUSTER-PGPOOL-NODE-ID" rel="noreferrer noreferrer">8.2.5. Create pgpool_node_id</a></h2><p>    From <span>Pgpool-II</span> 4.2, now all configuration parameters are identical on all hosts.
    If <tt>watchdog</tt> feature is enabled, to distingusish which host is which,
    a <tt>pgpool_node_id</tt> file is required.
    You need to create a <tt>pgpool_node_id</tt> file and specify the pgpool (watchdog) node number
    (e.g. 0, 1, 2 ...) to identify pgpool (watchdog) host. <br></p><p>In our systems the pgpool.conf are *identical *</p><p><br></p></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 26, 2021 at 8:09 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" rel="noreferrer noreferrer" target="_blank">niravbhatt.cpp@gmail.com</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"><div><div dir="auto">The difference lies in “other” server host names.</div></div><div><div dir="auto"><br></div><div dir="auto">-Nirav </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 26 Oct 2021 at 21.07, Luca Maranzano <<a href="mailto:liuk001@gmail.com" rel="noreferrer noreferrer" target="_blank">liuk001@gmail.com</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"><div dir="ltr"><div style="font-size:small">Hi,<br></div><div style="font-size:small"><br></div><div style="font-size:small">AFAIK the pgpool.conf file must be identical on all cluster nodes.</div><div style="font-size:small">Which are the differences in detail?</div><div style="font-size:small"><br></div><div style="font-size:small">Cheers</div></div><div dir="ltr"><div style="font-size:small">Luca</div><div style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 25, 2021 at 9:46 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" rel="noreferrer noreferrer" target="_blank">niravbhatt.cpp@gmail.com</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"><div dir="ltr">I added all ports via ufw on server1: 22,9999,9898,9000,9694,5433,5432<div><br><div>I enabled firewall past that point.</div><div><br></div><div>I diffed all conf files across servers - all files are same, including hba and .pgpass and .pcppass. </div><div>Only pgpool.conf files differ, that too in parameters like server hosts for pgpool and watchdog, no other differences.</div><div><br></div><div>No error is observed on primary server1. The last log lines on server1 says: new watchdog node connection is received from <server2> or <server3></div><div><br></div><div>But secondary server pgpool2 keeps exiting with: </div><div><br></div><div>Add to watchdog cluster request is rejected by node "server1:9000"<br></div><div><br></div><div>I somehow suspect it has to do with wd_authkey which I leave empty:  <a href="https://www.sraoss.jp/pipermail/pgpool-hackers/2017-August/002497.html" rel="noreferrer noreferrer" target="_blank">https://www.sraoss.jp/pipermail/pgpool-hackers/2017-August/002497.html</a></div><div><br></div><div>But it is an old issue, so I can't say for sure.</div><div><br></div><div>-Nirav</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 25, 2021 at 8:07 PM Luca Maranzano <<a href="mailto:liuk001@gmail.com" rel="noreferrer noreferrer" target="_blank">liuk001@gmail.com</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"><div dir="ltr"><div style="font-size:small">Firewall-cmd has to be used on Redhat derived flavours, on Ubuntu standard is ufw, so "ufw disable" should open all ports<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 25, 2021 at 6:59 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" rel="noreferrer noreferrer" target="_blank">niravbhatt.cpp@gmail.com</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"><div dir="ltr">I ran sudo ufw status and firewall is already inactive. <div><br></div><div>Not sure what firewall-cmd did for all the pgpool ports. (they are showing as list of open ports)</div><div><br></div><div>Should add them all via ufw also?</div><div><br></div><div>-Nirav</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 25, 2021 at 7:46 PM Luca Maranzano <<a href="mailto:liuk001@gmail.com" rel="noreferrer noreferrer" target="_blank">liuk001@gmail.com</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"><div dir="ltr"><div style="font-size:small">Try to disable firewall to see it it's related, all the pgpool configuration files are identical on the 3 nodes?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 25, 2021 at 6:41 PM Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" rel="noreferrer noreferrer" target="_blank">niravbhatt.cpp@gmail.com</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"><div dir="ltr">Hello,<div><br></div><div>Thanks for the response.</div><div><br></div><div>I restarted pgpool2 service on all 3 nodes (with some delay, and in the order: primary, secondary1, secondary2).</div><div>My primary pgpool2 service logs do show </div><div><br></div><div>LOG:  new watchdog node connection is received from <secondary host></div><div><br></div><div>But my secondary pgpool2 service logs (among other normal messages) show:</div><div><br></div><div>FATAL:  Add to watchdog cluster request is rejected by node "server1:9000"<br></div><div>FATAL:  watchdog child process exit with fatal error. exiting pgpool-II<br></div><div>LOG:  watchdog node state changed from [DEAD] to [LOADING]<br></div><div>LOG:  new outbound connection to server1:9000<br></div><div>FATAL:  Add to watchdog cluster request is rejected by node "server1:9000"<br></div><div>HINT:  check the watchdog configurations.<br></div><div>LOG:  Watchdog is shutting down<br></div><div><br></div><div>I checked that server1 has 9000 port open, along with 9999, 9898 and 9694:</div><div><br></div><div>> firewall-cmd --list-ports<br></div><div>9999/tcp 9898/tcp 9000/tcp 9694/udp<br></div><div><br></div><div>What could be going on?</div><div><br></div><div>-Nirav</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 25, 2021 at 7:13 PM Luca Maranzano <<a href="mailto:liuk001@gmail.com" rel="noreferrer noreferrer" target="_blank">liuk001@gmail.com</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"><div dir="ltr"><div style="font-size:small">Hi,</div><div style="font-size:small"><br></div><div style="font-size:small">if you cannot connect to <span class="gmail_default" style="font-size:small"></span>20.20.20.20 -p 9999 it means that hte PGPool cluster is not well formed and that the VIP has not been enabled.</div><div style="font-size:small"><br></div><div style="font-size:small">You can check that with pcp_watchdog_info.</div><div style="font-size:small">The logs from pgpool should also help to diagnose the problem.</div><div style="font-size:small"><br></div><div style="font-size:small">HTH</div><div style="font-size:small">Regards</div><div style="font-size:small">Luca</div><div style="font-size:small"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <span dir="auto"><<a href="mailto:pgpool-general-request@pgpool.net" rel="noreferrer noreferrer" target="_blank">pgpool-general-request@pgpool.net</a>></span><br>Date: Mon, Oct 25, 2021 at 5:00 AM<br>Subject: pgpool-general Digest, Vol 120, Issue 45<br>To:  <<a href="mailto:pgpool-general@pgpool.net" rel="noreferrer noreferrer" target="_blank">pgpool-general@pgpool.net</a>><br></div><br><br>Send pgpool-general mailing list submissions to<br>
        <a href="mailto:pgpool-general@pgpool.net" rel="noreferrer noreferrer" target="_blank">pgpool-general@pgpool.net</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer noreferrer noreferrer" target="_blank">https://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:pgpool-general-request@pgpool.net" rel="noreferrer noreferrer" target="_blank">pgpool-general-request@pgpool.net</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:pgpool-general-owner@pgpool.net" rel="noreferrer noreferrer" target="_blank">pgpool-general-owner@pgpool.net</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of pgpool-general digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. [pgpool-general: 7822] Pgpool2 example with watchdog: Unable<br>
      to test (Nirav Bhatt)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sun, 24 Oct 2021 20:18:28 +0300<br>
From: Nirav Bhatt <<a href="mailto:niravbhatt.cpp@gmail.com" rel="noreferrer noreferrer" target="_blank">niravbhatt.cpp@gmail.com</a>><br>
To: <a href="mailto:pgpool-general@pgpool.net" rel="noreferrer noreferrer" target="_blank">pgpool-general@pgpool.net</a><br>
Subject: [pgpool-general: 7822] Pgpool2 example with watchdog: Unable<br>
        to test<br>
Message-ID:<br>
        <CABz_77PMu9ksuYM2QGBaAuf=m_edGoKcidmWqC=K7Rpr=<a href="mailto:J_ZGw@mail.gmail.com" rel="noreferrer noreferrer" target="_blank">J_ZGw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
After doing all the config (config files, passwordless ssh, firewall-cmd<br>
etc) as given in the following link, I am unable to test my setup. My OS is<br>
Ubuntu 20.04.3 LTS.<br>
<br>
<a href="https://www.pgpool.net/docs/41/en/html/example-cluster.html#EXAMPLE-CLUSTER-STRUCTURE" rel="noreferrer noreferrer noreferrer" target="_blank">https://www.pgpool.net/docs/41/en/html/example-cluster.html#EXAMPLE-CLUSTER-STRUCTURE</a><br>
<br>
All the port numbers are as listed in the example.<br>
<br>
The part in example section: 8.3.7.1 and onwards is not working.<br>
<br>
When I run on server1 (my primary):<br>
psql -h <span class="gmail_default" style="font-size:small"></span>20.20.20.20 -p 9999 -U pgpool postgres -c "show pool_nodes"<br>
<br>
I got error:<br>
<br>
psql: error: connection to server at "20.20.20.20", port 9999 failed:<br>
Connection refused<br>
Is the server running on that host and accepting TCP/IP connections?<br>
<br>
I restarted postgresql and pgpool2 services time and again.<br>
<br>
pgpool2 service most recent logs:<br>
<br>
server1 (current primary):<br>
Oct 24 17:01:41 ip-10-192-10-10 pgpool[104691]: 2021-10-24 17:01:41: pid<br>
104691: LOG:  new watchdog node connection is received from "<server1<br>
host>:16553"<br>
Oct 24 17:01:41 ip-10-192-10-10 pgpool[104691]: 2021-10-24 17:01:41: pid<br>
104691: LOG:  new watchdog node connection is received from "<server1<br>
host>:17577"<br>
Oct 24 17:04:02 ip-10-192-10-10 pgpool[104691]: 2021-10-24 17:04:02: pid<br>
104691: LOG:  new watchdog node connection is received from "<server2<br>
host>:49304"<br>
Oct 24 17:04:02 ip-10-192-10-10 pgpool[104691]: 2021-10-24 17:04:02: pid<br>
104691: LOG:  new watchdog node connection is received from "<server2<br>
host>:50328"<br>
Oct 24 17:11:12 ip-10-192-10-10 pgpool[104691]: 2021-10-24 17:11:12: pid<br>
104691: LOG:  new watchdog node connection is received from "<server3<br>
host>:51864"<br>
Oct 24 17:11:12 ip-10-192-10-10 pgpool[104691]: 2021-10-24 17:11:12: pid<br>
104691: LOG:  new watchdog node connection is received from "<server3<br>
host>:52888"<br>
<br>
server2 and server3 (looks like pgpool2 service is failing):<br>
<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125018]: 2021-10-24 17:11:12: pid<br>
125018: LOG:  setting the local watchdog node name to "server3:5433 Linux<br>
ip-<server 3 host>"<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125018]: 2021-10-24 17:11:12: pid<br>
125018: LOG:  watchdog cluster is configured with 2 remote nodes<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125018]: 2021-10-24 17:11:12: pid<br>
125018: LOG:  watchdog remote node:0 on server1:9000<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125018]: 2021-10-24 17:11:12: pid<br>
125018: LOG:  watchdog remote node:1 on server2:9000<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125018]: 2021-10-24 17:11:12: pid<br>
125018: LOG:  interface monitoring is disabled in watchdog<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125018]: 2021-10-24 17:11:12: pid<br>
125018: LOG:  watchdog node state changed from [DEAD] to [LOADING]<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125018]: 2021-10-24 17:11:12: pid<br>
125018: LOG:  new outbound connection to server1:9000<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125018]: 2021-10-24 17:11:12: pid<br>
125018: FATAL:  Add to watchdog cluster request is rejected by node<br>
"server1:9000"<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125018]: 2021-10-24 17:11:12: pid<br>
125018: HINT:  check the watchdog configurations.<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125018]: 2021-10-24 17:11:12: pid<br>
125018: LOG:  Watchdog is shutting down<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125014]: 2021-10-24 17:11:12: pid<br>
125014: LOG:  watchdog child process with pid: 125018 exits with status 768<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125014]: 2021-10-24 17:11:12: pid<br>
125014: FATAL:  watchdog child process exit with fatal error. exiting<br>
pgpool-II<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125019]: 2021-10-24 17:11:12: pid<br>
125019: LOG:  setting the local watchdog node name to "server3:5433 Linux<br>
ip-<server 3 host>"<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125019]: 2021-10-24 17:11:12: pid<br>
125019: LOG:  watchdog cluster is configured with 2 remote nodes<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125019]: 2021-10-24 17:11:12: pid<br>
125019: LOG:  watchdog remote node:0 on server1:9000<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125019]: 2021-10-24 17:11:12: pid<br>
125019: LOG:  watchdog remote node:1 on server2:9000<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125019]: 2021-10-24 17:11:12: pid<br>
125019: LOG:  interface monitoring is disabled in watchdog<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125019]: 2021-10-24 17:11:12: pid<br>
125019: LOG:  watchdog node state changed from [DEAD] to [LOADING]<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125019]: 2021-10-24 17:11:12: pid<br>
125019: LOG:  new outbound connection to server1:9000<br>
Oct 24 17:11:12 ip-10-192-12-30 pgpool[125019]: 2021-10-24 17:11:12: pid<br>
125019: LOG:  Watchdog is shutting down<br>
Oct 24 17:11:12 ip-10-192-12-30 systemd[1]: pgpool2.service: Main process<br>
exited, code=exited, status=3/NOTIMPLEMENTED<br>
Oct 24 17:11:12 ip-10-192-12-30 systemd[1]: pgpool2.service: Failed with<br>
result 'exit-code'.<br>
<br>
What steps am I missing?<br>
<br>
Thank you for the assistance,<br>
-Nirav<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://www.pgpool.net/pipermail/pgpool-general/attachments/20211024/98ab6d68/attachment-0001.htm" rel="noreferrer noreferrer noreferrer" target="_blank">http://www.pgpool.net/pipermail/pgpool-general/attachments/20211024/98ab6d68/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net" rel="noreferrer noreferrer" target="_blank">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer noreferrer noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
<br>
<br>
------------------------------<br>
<br>
End of pgpool-general Digest, Vol 120, Issue 45<br>
***********************************************<br>
</div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>