Cannot create stanza for pgBackRest

Hi everyone,

i have installed pgBackRest on PRIMARY database server. After change config parameters of pgBackRest, i tried to create stanza but it failed. It show error

[postgres@postgres-db01 ~]$ pgbackrest --stanza=acb_stanza stanza-create
2023-04-16 03:58:53.940 P00 INFO: stanza-create command begin 2.45: --exec-id=10649-13d77bf3 --log-level-console=info --log-level-file=debug --log-path=/backup/pgBackRest/log --pg1-path=/data/FEP/datafile --pg1-port=27500 --pg1-socket-path=/tmp --repo1-path=/backup/pgBackRest --stanza=acb_stanza
WARN: unable to check pg1: [DbConnectError] unable to connect to ‘dbname=‘postgres’ port=27500 host=’/tmp’': connection to server on socket “/tmp/.s.PGSQL.27500” failed: fe_sendauth: no password supplied
ERROR: [056]: unable to find primary cluster - cannot proceed
HINT: are all available clusters in recovery?
2023-04-16 03:58:53.945 P00 INFO: stanza-create command end: aborted with exception [056]

Content of pgBackRest configuration file is:
[global]
repo1-path=/backup/pgBackRest
log-level-console=info
log-level-file=debug
start-fast=y
log-path=/backup/pgBackRest/log
repo1-retention-archive=5
repo1-retention-archive-type=full
repo1-retention-full=2

[acb_stanza]
pg1-path=/data/FEP/datafile
pg1-port=27500
pg1-host=postgres-db01
pg1-socket-path=/tmp

Please help me to resolve the problem when i create stanza.

Thank you so much

Anyone can help me, pls ? :frowning:

Hello,

Welcome to the Percona community forum.

First, try section 1; if the issue persists, follow section 2.

Section 1:

  1. For the postgres O.S user , set up the passwordless ssh for the postgres-db01 host from the same (postgres-db01) server.

After setting up the passwordless ssh, the below command will not ask you for the password.

[postgres@postgres-db01 ~]$ ssh postgres@postgres-db01

  1. Execute create stanza command.

Section 2.
Please follow the below steps and let me know the result of create stanza command.

  1. Login by using postgres O.S. user on the primary server.

  2. cd

  3. create the .pgpass file if not present and insert the DB user password.

vi .pgpass

postgres-db01:27500:*:postgres:postgresdbuserpassword

Save the file

  1. chmod 600 .pgpass

Exit and log in using the Postgres O.S user and run the create stanza command.

Please refer to the below URL for more information on pgbackrest.

Please let me know the result.