<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you for that reply. I finally got some time to test this again and it works perfectly!</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div></div>
<div></div>
<div></div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<div>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font color="#000000"><b><font color="#000000"><font size="2" style="font-size:10pt">Jon Schewe</font></font></b></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font color="#000000"><font size="2" style="font-size:9pt">Principal Software Systems Technologist</font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font color="#000000"><font color="#c00000"><font size="2" style="font-size:9pt"><b><br>
</b></font></font></font><font color="#000000"><font size="2" style="font-size:9pt">C: +1 612.263.2718<br>
</font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font color="#000000"><font size="2" style="font-size:9pt">O: +1 952.545.5720</font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font color="#0563c1"><font size="2"><u>jon.schewe@raytheon.com</u></font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-top:0.08in; margin-bottom:0.11in; line-height:100%">
<font face="Arial, serif"><font size="3" style="font-size:12pt"><font color="#000000"><font color="#c00000"><font size="2" style="font-size:9pt"><span lang="fr-BE"><b><br>
</b></span></font></font></font><font color="#000000"><font color="#ce1126"><font size="2" style="font-size:10pt"><span lang="fr-BE"><b>Raytheon Technologies</b></span></font></font></font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font size="3" style="font-size:12pt"><font color="#000000"><font size="2" style="font-size:9pt">Raytheon Intelligence & Space</font></font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font size="3" style="font-size:12pt"><font color="#000000"><font size="2" style="font-size:9pt">5775 Wayzata Blvd. Suite 630</font></font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font size="3" style="font-size:12pt"><font color="#000000"><font size="2" style="font-size:9pt">St. Louis Park, MN 55416</font></font></font></font>
</p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<br>
</p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:120%">
<font face="Arial, serif"><font size="3" style="font-size:12pt"><font color="#0563c1"><u><a href="https://www.rtx.com/" style="color:rgb(5,99,193)"><font color="#000000"><font size="1" style="font-size:8pt">RTX.com</font></font></a></u></font><font color="#000000"><font color="#000000"><font size="1" style="font-size:8pt"><span style="text-decoration:none">
</span></font></font></font><font color="#ce1126"><font size="2" style="font-size:9pt">|</font></font><font color="#ce1126"><font size="1" style="font-size:8pt">
</font></font><font color="#0563c1"><u><a href="https://www.linkedin.com/company/raytheontechnologies" style="color:rgb(5,99,193)"><font color="#000000"><font size="1" style="font-size:8pt">LinkedIn</font></font></a></u></font><font color="#000000"><font color="#ce1126"><font size="1" style="font-size:8pt"><span style="text-decoration:none">
</span></font></font></font><font color="#ce1126"><font size="2" style="font-size:9pt">|</font></font><font color="#ce1126"><font size="1" style="font-size:8pt">
</font></font><font color="#0563c1"><u><a href="https://twitter.com/raytheontech" style="color:rgb(5,99,193)"><font color="#000000"><font size="1" style="font-size:8pt">Twitter</font></font></a></u></font><font color="#000000"><font color="#ce1126"><font size="1" style="font-size:8pt"><span style="text-decoration:none">
</span></font></font></font><font color="#ce1126"><font size="2" style="font-size:9pt">|</font></font><font color="#ce1126"><font size="1" style="font-size:8pt">
</font></font><font color="#0563c1"><u><a href="https://www.instagram.com/raytheontechnologies" style="color:rgb(5,99,193)"><font color="#000000"><font size="1" style="font-size:8pt">Instagram</font></font></a></u></font><font color="#000000"><font color="#ce1126"><font size="1" style="font-size:8pt"><span style="text-decoration:none">
</span></font></font></font></font></font></p>
<br>
</div>
</div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> pgpool-general <pgpool-general-bounces@pgpool.net> on behalf of Bo Peng <pengbo@sraoss.co.jp><br>
<b>Sent:</b> Wednesday, November 10, 2021 02:27<br>
<b>To:</b> Nirav Bhatt <niravbhatt.cpp@gmail.com><br>
<b>Cc:</b> pgpool-general <pgpool-general@pgpool.net><br>
<b>Subject:</b> [External] [pgpool-general: 7871] Re: PCP recovery node Error: Recovery request is only allowed in replication and streaming replication modes</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hello,<br>
<br>
> thanks for the quick answer.<br>
> <br>
> I deleted pgpool_status and modified pgpool conf files for master slave<br>
> streaming replication mode.<br>
> <br>
> Now still the 2 things are puzzling:<br>
> <br>
> 1-When I start pg and pgpool on all 3 servers, the status looks good in<br>
> show pool nodes.<br>
> However, when I try to do pcp_recovery_node for node 1 (41 tutorial section<br>
> 8.3.7.1), it failed saying it node 1 is alive.<br>
<br>
It seems you have already setup a PostgreSQL streaming replication cluster.<br>
If all the PostgreSQL nodes are started, you don't need to run pcp_recovery_node.<br>
<br>
pcp_recovery_node is used to create or recover standby nodes.<br>
<br>
> Then, I tried stopping pg and pgpool on node 1, and tried again.<br>
> This time, it failed again. The log on server1 shows this:<br>
> <br>
> ERROR:  replication slot "server2" does not exist<br>
> failover.sh: drop replication slot server2 failed<br>
<br>
Because the standby nodes are not created by pcp_recovery_node command,<br>
the replication slots are not created.<br>
<br>
Try the following steps to reset the cluster:<br>
<br>
1. Start only PostgreSQL primary node (just one node)<br>
2. Start Pgpool-II (If you are using watchdog, start all of the pgpool nodes)<br>
3. Run "show pool_nodes" command to check the status of backend nodes.<br>
   Please make sure, node0 (primary) is "up", and other nodes are "down".<br>
4. Run pcp_recovery_node command to create PostgreSQL standby nodes.<br>
<br>
> So either my postgresql setup is not correct, or I missed something in the<br>
> order pgpool should be set up.<br>
> <br>
> (upon further investigation I found that this slot must have been created<br>
> by follow_master script.<br>
> I do not know where that script must be called during initialization. I do<br>
> not see it being called in server1 (master) logs)<br>
> <br>
> I have done everything in the order that this tutorial (41) has described -<br>
> but it is clear some things are not mentioned in that and I missed them<br>
> several times.<br>
> <a href="https://www.pgpool.net/docs/41/en/html/example-cluster.html">https://www.pgpool.net/docs/41/en/html/example-cluster.html</a><br>
> <br>
> What exactly is pcp_recovery_node - is not clear to me.<br>
> Is it to bring up the fresh (never failed) standby node (see section #<br>
> 8.3.7.1 in the tutorial), or a failed node back in the system (Tutorial<br>
> section # 8.3.7.4)?<br>
> Is it mandatory to be called manually during pgpool cluster initialization?<br>
> <br>
> Most importantly: When pcp_recovery_node is invoked, what services should<br>
> be stopped on the soon-to-be standby node: pg or pgpool, both or no-one?<br>
> <br>
> 2-One more thing I observed is that past starting pgpool and pg on all 3,<br>
> when I created a table on master (also inserted 2 rows into it) - I<br>
> expected it to be replicated to other servers.<br>
> But it didn't happen.<br>
> So I am sure something is missing in my postgres replication setup, and it<br>
> will be quite helpful if it is mentioned.<br>
> I am attaching my postgresql.conf.<br>
<br>
No. You don't need to configure postgresql replication setup by yourself.<br>
At the initial state, you need to just create one PostgreSQL primary node.<br>
pcp_recovery_node commadn will create standby nodes for you.<br>
<br>
> Thanks for the support,<br>
> -Nirav<br>
> <br>
> On Sun, Nov 7, 2021 at 5:04 AM Tatsuo Ishii <ishii@sraoss.co.jp> wrote:<br>
> <br>
> > > Hello,<br>
> > ><br>
> > > After setting up pgpool2 4.1 based on below tutorial, I kept getting<br>
> > > unreliable behavior.<br>
> > ><br>
> > > <a href="https://www.pgpool.net/docs/41/en/html/example-cluster.html">https://www.pgpool.net/docs/41/en/html/example-cluster.html</a><br>
> > ><br>
> > > So I followed all the steps and realized that I was not setting standbys<br>
> > as<br>
> > > suggested.<br>
> > ><br>
> > > First I start all 3 servers:<br>
> > ><br>
> > > systemctl start postgresql<br>
> > > systemctl start pgpool2<br>
> > ><br>
> > > After, when I ran following command from my primary:<br>
> > ><br>
> > > pcp_recovery_node -h {VIRTUAL IP} -p 9898 -U pgpool  -n 1<br>
> > ><br>
> > > It gave me error:<br>
> > ><br>
> > > ERROR:  process recovery request failed<br>
> > > DETAIL:  recovery request is only allowed in replication and streaming<br>
> > > replication modes.<br>
> > ><br>
> > > The tutorial does not mention much about how to set up streaming<br>
> > > replication mode. I set up all params in postgresql.conf as per the<br>
> > > tutorial.<br>
> > ><br>
> > > I have 2 questions:<br>
> > > 1 - what is the main issue? Is it the above error about streaming<br>
> > > replication mode?<br>
> > > 2 - If not, is my original setup is problematic?<br>
> ><br>
> > It is likely there's a mistake in your setup. The error says your<br>
> > setup is not either streaming replication mode nor native replication<br>
> > mode. You should check your pgpool.conf on *all* of the 3 nodes,<br>
> > especially make sure that:<br>
> ><br>
> > master_slave_mode = on<br>
> > master_slave_sub_mode = 'stream'<br>
> ><br>
> > > I have strong feeling it is the case:<br>
> > > Even when I stop pgpool on all nodes, and start node0, show pool_nodes<br>
> > show<br>
> > > node 0 as down, and node 1 as master (even though pgpool service is not<br>
> > > even running there!)<br>
> > > I repeatedly stopped and started postgres and pgpool, but node 1<br>
> > constantly<br>
> > > remains the master.<br>
> ><br>
> > If your setup is a correct streaming replication mode, show pool_nodes<br>
> > should show each PostgreSQL role as "primary" or "standby". So I<br>
> > suspect there's a mistake in your setup.<br>
> ><br>
> > > Is there a way to reset all the previous runs of pgpool (maybe some old<br>
> > > state causing issues)<br>
> ><br>
> > Yes. the status file is located as "/var/log/pgpool/pgpool_status".<br>
> > It's a simple text file. It represents each PostgreSQL status<br>
> > something like "up" or "down" in each row.  You can safely remove the<br>
> > file while pgpool is stopping. The file will be automatically<br>
> > recreated upon starting up of pgpool and the current status will be<br>
> > reflected to the file.<br>
> ><br>
> > > Once I solve it, I also need to solve how to set up proper standby server<br>
> > > using pcp_recovery_node<br>
> > ><br>
> > > This setup is driving me mad.<br>
> > > -Nirav<br>
> ><br>
> > Please stay calm. Setting up a PostgreSQL cluster is not an easy task<br>
> > for everyone.<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">http://www.sraoss.co.jp/index_en.php</a><br>
> > Japanese:http://www.sraoss.co.jp<br>
> ><br>
<br>
<br>
-- <br>
Bo Peng <pengbo@sraoss.co.jp><br>
SRA OSS, Inc. Japan<br>
<a href="http://www.sraoss.co.jp/">http://www.sraoss.co.jp/</a><br>
_______________________________________________<br>
pgpool-general mailing list<br>
pgpool-general@pgpool.net<br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
</div>
</span></font></div>
</body>
</html>