not able to connect.

From: Aman Dhaka <aman(dot)dhaka(at)publicissapient(dot)com>
To: "pgsql-novice(at)lists(dot)postgresql(dot)org" <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: not able to connect.
Date: 2020-03-18 00:59:30
Message-ID: BY5PR02MB6817C41FB04BC39D4E16FCD190F70@BY5PR02MB6817.namprd02.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi All,

I have setup postgresql and was trying passwordless pg_basebackup.

So I defined .pgpass as below in home location of master as well as slave :-

-bash-4.2$ ls -lart
total 20
-rwx------. 1 postgres postgres 266 Mar 17 16:02 .bash_profile
drwxr-xr-x. 35 root root 4096 Mar 17 16:04 ..
drwx------. 4 postgres postgres 51 Mar 17 18:13 10
-rw-------. 1 postgres postgres 44 Mar 18 00:32 .pgpass

-bash-4.2$ cat .pgpass
10.85.4.39:5432:replication:repuser:repsuer

postgres=# show hba_file ;
hba_file
-----------------------------------
/mnt/disks/data/pdata/pg_hba.conf
(1 row)

postgres=# \q
-bash-4.2$ cat /mnt/disks/data/pdata/pg_hba.conf
local all postgres trust
host all all 0.0.0.0/0 scram-sha-256
host all all ::/0 scram-sha-256
host all all 10.85.4.39/32 md5
host replication repuser 10.85.4.39/32 md5
host replication repuser 10.85.4.37/32 md5
host replication repuser 10.85.4.41/32 md5
-bash-4.2$ psql -d postgres -h 10.85.4.39 -p 5432 -U repuser
Password for user repuser:
psql: FATAL: password authentication failed for user "repuser"

from slave :-

-bash-4.2$ pg_basebackup -h 10.85.4.39 -D /mnt/disks/data/pdata/ -P -U repuser --wal-method=stream -w
pg_basebackup: could not connect to server: FATAL: password authentication failed for user "repuser"
password retrieved from file "/var/lib/pgsql/.pgpass"
pg_basebackup: removing contents of data directory "/mnt/disks/data/pdata/"

I am not able to connect, please help. Without pgpass I have to manually give password at slave to setup replication via pg_basebackup but I was trying to disable password and got stuck as shown above.
Please help.

Thanks,
Aman

------------------------------------------------------------------------
Disclaimer The information in this email and any attachments may contain proprietary and confidential information that is intended for the addressee(s) only. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, retention or use of the contents of this information is prohibited. When addressed to our clients or vendors, any information contained in this e-mail or any attachments is subject to the terms and conditions in any governing contract. If you have received this e-mail in error, please immediately contact the sender and delete the e-mail.

Browse pgsql-novice by date

  From Date Subject
Next Message Tamara Tardif 2020-03-19 16:32:02 Alter Table from Trigger
Previous Message Elizabeth Fernandez 2020-03-11 12:53:49 Re: Major upgrade from 9.6.15 to 12.2