<div dir="ltr"><div>I'm doing the initial installation using Ansible. <br></div><div>I think the problem was that on the initial installation where node 0 (qs-auth-01.dc.internal) should be the primary I was executing:</div><div><br></div><div>pcp_recovery_node -w -h {{ delegate_virtual_ip }} -p 9898 -U pgpool -n 0</div><div><br></div><div>instead of <br></div><div><br></div><div>
<div>pcp_recovery_node -w -h {{ delegate_virtual_ip }} -p 9898 -U pgpool -n 1</div><div><br></div><div>because my node index calculation had a bug.</div><div>I'll check it out during this afternoon and I'll update the thread if the problem persists.</div><div><br></div><div>Regards,</div><div>LA<br></div></div><div> <br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 17, 2020 at 12:21 PM 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">> Now they are correct and it can connect. Nevertheless, I'm having<br>
> other issues. Here is the Backend Connection Settings<br>
> <br>
> <br>
> # - Backend Connection Settings -<br>
> backend_hostname0 = 'qs-auth-01.dc.internal'<br>
> backend_port0 = 5432<br>
> backend_weight0 = 1<br>
> backend_data_directory0 = '/export/pgsql/data'<br>
> backend_flag0 = 'ALLOW_TO_FAILOVER'<br>
> backend_application_name0 = 'qs-auth-01.dc.internal'<br>
> backend_hostname1 = 'qs-auth-02.dc. internal '<br>
> backend_port1 = 5432<br>
> backend_weight1 = 1<br>
> backend_data_directory1 = '/export/pgsql/data'<br>
> backend_flag1 = 'ALLOW_TO_FAILOVER'<br>
> backend_application_name1 = 'qs-auth-02.dc.internal'<br>
> <br>
> <br>
> node qs-auth-01.dc.internal should be the primary and has postgres running<br>
> there, but pgpool seems to ignore it.<br>
> node qs-auth-02.dc.internal is shutdown as I want to apply replication from<br>
> node 1.<br>
> <br>
> Here is the log:<br>
><br>
> Dec 17 09:18:32 qs-auth-02 pgpool[20471]: [915-1] 2020-12-17 09:18:32: pid<br>
> 20471: ERROR:  failed to make persistent db connection<br>
> Dec 17 09:18:32 qs-auth-02 pgpool[20471]: [915-2] 2020-12-17 09:18:32: pid<br>
> 20471: DETAIL:  connection to host:"qs-auth-02.dc.internal:5432" failed<br>
> Dec 17 09:18:32 qs-auth-02 pgpool[20471]: [916-1] 2020-12-17 09:18:32: pid<br>
> 20471: LOG:  health check retrying on DB node: 1 (round:2)<br>
> Dec 17 09:18:33 qs-auth-02 pgpool[20471]: [917-1] 2020-12-17 09:18:33: pid<br>
> 20471: LOG:  failed to connect to PostgreSQL server on<br>
> "qs-auth-02.dc.internal:5432", getsockopt() detected error "Connection<br>
> refused"<br>
> Dec 17 09:18:33 qs-auth-02 pgpool[20471]: [918-1] 2020-12-17 09:18:33: pid<br>
> 20471: ERROR:  failed to make persistent db connection<br>
> Dec 17 09:18:33 qs-auth-02 pgpool[20471]: [918-2] 2020-12-17 09:18:33: pid<br>
> 20471: DETAIL:  connection to host:"qs-auth-02.dc.internal:5432" failed<br>
> Dec 17 09:18:33 qs-auth-02 pgpool[20471]: [919-1] 2020-12-17 09:18:33: pid<br>
> 20471: LOG:  health check retrying on DB node: 1 (round:3)<br>
> Dec 17 09:18:34 qs-auth-02 pgpool[20471]: [920-1] 2020-12-17 09:18:34: pid<br>
> 20471: LOG:  failed to connect to PostgreSQL server on<br>
> "qs-auth-02.dc.internal:5432", getsockopt() detected error "Connection<br>
> refused"<br>
> <br>
> I see nothing in the node qs-auth-01.dc.internal postgres logs. Is there<br>
> another place where pgpool looks to find postgres servers?<br>
<br>
Probably pgpool recognizes backend_hostname0 (qs-auth-01.dc.internal)<br>
as in "down" or "unused" status.  You can verify it by executing "show<br>
pool_nodes" from psql command connecting to 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>
</blockquote></div>