From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
Cc: postgre <pgsql-general@lists.postgresql.org>
Subject: Re: pg_basebackup with hostssl ?
Date: Wed, 2 Feb 2022 08:50:31 -0800
Message-ID: <c9ff64a4-8d52-fedb-8048-eb5b37813858@aklaver.com> (raw)
In-Reply-To: <bWDaEVjsYVXQR-ZHbIR0Pqal3hBr9PIXZNgDM_4aUEpupEbkKgEMfk-rHDW1dBVhZH1Zslo5YrydOeQ9_B6n2vGxVMG6DtotTKvdzoUQBF4=@protonmail.ch>
References: <u4Ap-j-o9BPs6E3w5BxzpDTvGCzkTspSkq6Nn56_lHoDWbWH14IUa8UkUTNRkHczE4wuIpAXLe5ucMGQZ-w1UVJf78BfrtyAygZXWYkBMpc=@protonmail.ch>
<fbb08293-b11e-a106-19a6-d2b180e45411@aklaver.com>
<bWDaEVjsYVXQR-ZHbIR0Pqal3hBr9PIXZNgDM_4aUEpupEbkKgEMfk-rHDW1dBVhZH1Zslo5YrydOeQ9_B6n2vGxVMG6DtotTKvdzoUQBF4=@protonmail.ch>
On 2/2/22 08:37, Laura Smith wrote:
>
>
> Sent with ProtonMail Secure Email.
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>
> On Wednesday, February 2nd, 2022 at 16:30, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>
>> I am not following. pg_basebackup is a stand alone client that is not
>>
>> involved in replication other then establishing a starting point from
>>
>> which to later establish a replication relationship.
>>
>
> Indeed. And that is exactly that I am trying to do (i.e. have master, want new slave).
>
>> The error is saying that whatever instance you are pointing
>>
>> pg_basebackup at does not have entry in pg_hba.conf for the
>>
>> host/user/encryption combination pg_basebackup is trying to connect as.
>>
>
> But it *DOES* have an entry, per my original message:
> "hostssl replication all 10.0.0.0/8 md5"
From the OP:
"
Long story short, I've got the following in pg_hba.conf of the master:
hostssl replication all 10.0.0.0/8 md5
But the slave is complaining:
FATAL: no pg_hba.conf entry for replication connection from host
"10.1.2.3", user "myrepl", no encryption
"
The error is coming from a connection to the slave which does not have
data yet, correct? Or a matching pg_hba.conf entry, it would seem.
>
> And yes, that hba is loaded and live because other remote clients are happily connected to that server and thus reliant on a valid hba.conf.
>
> The host is correct. The user is correct.
>
> The point I am making is that pg_basebackup is connecting without encryption and I want to know how to tell it to use encryption. The docs are silent on the subject.
Not completely:
https://www.postgresql.org/docs/current/app-pgbasebackup.html
-d connstr
--dbname=connstr
Specifies parameters used to connect to the server, as a
<connection string>; these will override any conflicting command line
options.
The option is called --dbname for consistency with other client
applications, but because pg_basebackup doesn't connect to any
particular database in the cluster, any database name in the connection
string will be ignored.
Following the <connection string> link:
https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING
You can use that to set sslmode.
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, n5d9xq3ti233xiyif2vp@protonmail.ch
Subject: Re: pg_basebackup with hostssl ?
In-Reply-To: <c9ff64a4-8d52-fedb-8048-eb5b37813858@aklaver.com>
References: <u4Ap-j-o9BPs6E3w5BxzpDTvGCzkTspSkq6Nn56_lHoDWbWH14IUa8UkUTNRkHczE4wuIpAXLe5ucMGQZ-w1UVJf78BfrtyAygZXWYkBMpc=@protonmail.ch> <fbb08293-b11e-a106-19a6-d2b180e45411@aklaver.com> <bWDaEVjsYVXQR-ZHbIR0Pqal3hBr9PIXZNgDM_4aUEpupEbkKgEMfk-rHDW1dBVhZH1Zslo5YrydOeQ9_B6n2vGxVMG6DtotTKvdzoUQBF4=@protonmail.ch> <c9ff64a4-8d52-fedb-8048-eb5b37813858@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox