[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: replication strange behavior
From:       Atul Kumar <akumar14871 () gmail ! com>
Date:       2023-11-30 23:54:50
Message-ID: CA+ONtZ5LmX6VCuu1CCTh-Ghs9Kok5LNCsxXRL491b8sJDS5FuA () mail ! gmail ! com
[Download RAW message or body]

Hi,

In the master pg_hba.conf file, standby server hostname name is not being
read even with the domain name, but server ip is working fine.

output of /etc/hosts is given below

127.0.0.1   localhost localhost.localdomain localhost4
localhost4.localdomain4
::1         localhost localhost.localdomain localhost6
localhost6.localdomain6
<server ip> <hostname>.domainname hostname


Regards.

On Fri, Dec 1, 2023 at 3:33 AM Ron Johnson <ronljohnsonjr@gmail.com> wrote:

> On Thu, Nov 30, 2023 at 3:41 PM Atul Kumar <akumar14871@gmail.com> wrote:
>
>> Hi,
>>
>> I have postgres 12 running in centos 7.
>>
>> I have configured streaming replication between one master and one
>> standby server.
>>
>> In the pg_hba.conf file of the master server, I have put the standby
>> server's hostname instead of IP and due to which replication got broken and
>> I started getting below error.
>>
>> FATAL:  no pg_hba.conf entry for replication connection from host
>> "10.20.8.22", user "replication", SSL off
>>
>> 2023-11-30 12:00:25 PST|pid=24096|FATAL:  XX000: could not connect to the
>> primary server: FATAL:  no pg_hba.conf entry for replication connection
>>
>> from host "10.20.8.22", user "replication", SSL on
>>
>>
>> I put the ip of standby back in pg_hba.conf file of the master server and
>> replication got started, though in the standby server I mentioned the
>> hostname of master in primary_conninfo on the standby side.
>>
>>
>> So why is the master not reading the hostname of standby ? What am I
>> missing here ?
>>
>
> You'd have to show us pg_hba.conf and /etc/hosts.
>
> My guess, though, is that you're not taking the domain name into account.
>
>

[Attachment #3 (text/html)]

<div dir="ltr">Hi,<div><br></div><div>In the master pg_hba.conf file, standby server \
hostname name is not being read even with the domain name, but server ip is working \
fine.</div><div><br></div><div>output of /etc/hosts is given \
below</div><div><br></div><div>127.0.0.1    localhost localhost.localdomain \
localhost4 localhost4.localdomain4<br>::1             localhost localhost.localdomain \
localhost6 localhost6.localdomain6<br>&lt;server ip&gt; &lt;hostname&gt;.domainname \
hostname<br></div><div><br></div><div><br></div><div>Regards.</div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 1, 2023 at \
3:33 AM Ron Johnson &lt;<a \
href="mailto:ronljohnsonjr@gmail.com">ronljohnsonjr@gmail.com</a>&gt; \
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">On Thu, Nov 30, 2023 at 3:41 PM Atul Kumar &lt;<a \
href="mailto:akumar14871@gmail.com" target="_blank">akumar14871@gmail.com</a>&gt; \
wrote:<br></div><div class="gmail_quote"><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,<div><br></div><div>I have \
postgres 12 running in centos 7.</div><div><br></div><div>I have configured streaming \
replication between one master and one standby server.</div><div><br></div><div>In \
the pg_hba.conf file of the master server, I have put the standby server&#39;s \
hostname instead of IP and due to which replication got broken and I started getting \
below error.</div><div><br></div><div><p class="MsoNormal" \
style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span \
lang="EN-US">FATAL:   no pg_hba.conf entry for replication connection from host
&quot;10.20.8.22&quot;, user &quot;replication&quot;, SSL off</span></p>

<p class="MsoNormal" \
style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span \
lang="EN-US">2023-11-30 12:00:25 PST|pid=24096|FATAL:   XX000: could not connect to \
                the primary
server: FATAL:   no pg_hba.conf entry for replication connection</span></p>

<p class="MsoNormal" \
style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span \
lang="EN-US">from host &quot;10.20.8.22&quot;, user &quot;replication&quot;, SSL \
on</span></p><p class="MsoNormal" \
style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span \
lang="EN-US"><br></span></p><p class="MsoNormal" \
style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-US">I \
put the ip of standby back in  </span><span \
style="font-family:Arial,Helvetica,sans-serif;font-size:small">pg_hba.conf file of \
the master server  </span><span style="font-size:11pt">and replication got started, \
though in the standby server I mentioned the hostname of master in primary_conninfo \
on the standby side.</span></p><p class="MsoNormal" \
style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span \
style="font-size:11pt"><br></span></p><p class="MsoNormal" \
style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span \
style="font-size:11pt">So why is the </span>master not<span style="font-size:11pt"> \
reading the hostname of standby ? What am I missing here \
?</span></p></div></div></blockquote><div>  </div><div>You&#39;d have to show us \
pg_hba.conf and /etc/hosts.</div><div><br></div><div>My guess, though, is that \
you&#39;re not taking the domain name into account.</div><div>  </div></div></div> \
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic