Обсуждение: issue with remote backup

Поиск
Список
Период
Сортировка

issue with remote backup

От
Atul Kumar
Дата:
Hi,

I have the postgres12 version running on centos7.

In pg_hba.conf file I have an entry like below:

host    all             all             <remote server ip>/32            md5

So from the above entry, I understand that all users can connect to all databases from the remote ip.


But when I use pg_basebackup from remote server using below command I get the below error:

pg_basebackup -h DB_server_hostname -p 5444 -U postgres -D /var/lib/edb/backups/10262023_1 -Fp -Xs -c fast -P

Error that I got:

pg_basebackup: error: FATAL:  no pg_hba.conf entry for replication connection from host "remote_ip", user "postgres", SSL off

So please help me understand why I am getting this error even after having a related entry in the pg_hba.conf file.




 Regards.

Re: issue with remote backup

От
Tom Lane
Дата:
Atul Kumar <akumar14871@gmail.com> writes:
> In pg_hba.conf file I have an entry like below:

> host    all             all             <remote server ip>/32            md5

That is an entry governing ordinary session connections ...

> Error that I got:
> pg_basebackup: error: FATAL:  no pg_hba.conf entry for replication
> connection from host "remote_ip", user "postgres", SSL off

... and that is complaining about the lack of an entry for
replication connections.  They are handled by different pg_hba.conf
entries.

            regards, tom lane



Re: issue with remote backup

От
Adrian Klaver
Дата:
On 10/26/23 09:51, Atul Kumar wrote:
> Hi,
> 
> I have the postgres12 version running on centos7.
> 
> In pg_hba.conf file I have an entry like below:
> 
> host    all             all             <remote server ip>/32            md5
> 
> So from the above entry, I understand that all users can connect to all 
> databases from the remote ip.
> 
> 
> But when I use pg_basebackup from remote server using below command I 
> get the below error:
> 
> pg_basebackup -h DB_server_hostname -p 5444 -U postgres -D 
> /var/lib/edb/backups/10262023_1 -Fp -Xs -c fast -P
> 
> Error that I got:
> 
> pg_basebackup: error: FATAL:  no pg_hba.conf entry for replication 
> connection from host "remote_ip", user "postgres", SSL off
> 
> So please help me understand why I am getting this error even after 
> having a related entry in the pg_hba.conf file.


https://www.postgresql.org/docs/current/auth-pg-hba-conf.html

"
database

     Specifies which database name(s) this record matches. The value all 
specifies that it matches all databases. The value sameuser specifies 
that the record matches if the requested database has the same name as 
the requested user. The value samerole specifies that the requested user 
must be a member of the role with the same name as the requested 
database. (samegroup is an obsolete but still accepted spelling of 
samerole.) Superusers are not considered to be members of a role for the 
purposes of samerole unless they are explicitly members of the role, 
directly or indirectly, and not just by virtue of being a superuser. The 
value replication specifies that the record matches if a physical 
replication connection is requested, however, it doesn't match with 
logical replication connections. Note that physical replication 
connections do not specify any particular database whereas logical 
replication connections do specify it. Otherwise, this is the name of a 
specific PostgreSQL database or a regular expression. Multiple database 
names and/or regular expressions can be supplied by separating them with 
commas.

     If the database name starts with a slash (/), the remainder of the 
name is treated as a regular expression. (See Section 9.7.3.1 for 
details of PostgreSQL's regular expression syntax.)

     A separate file containing database names and/or regular 
expressions can be specified by preceding the file name with @.

"

> 
> 
> 
> 
>   Regards.

-- 
Adrian Klaver
adrian.klaver@aklaver.com