0

I follow this guide to setup.

https://medium.com/@victor.boissiere/how-to-setup-postgresql-cluster-with-repmgr-febc2f10c243

Everythings going fine but when come to here

sudo -i -u repmgr
rm -rf /var/lib/postgresql/9.5/main
repmgr -h server1 -U repmgr -d repmgr standby clone
exit
sudo service postgresql start
sudo -i -u repmgr
repmgr standby register

After use command repmgr -h server1 -U repmgr -d repmgr standby clone (in my case server1 = DB1)

this happened in log file:

[2019-11-14 04:36:14] [NOTICE] setting data directory to: /var/lib/postgresql/9.5/main
[2019-11-14 04:36:14] [HINT] use -D/--data-dir to explicitly specify a data directory
[2019-11-14 04:36:14] [NOTICE] starting backup...
[2019-11-14 04:36:14] [HINT] this may take some time; consider using the -c/--fast-checkpoint option
NOTICE:  pg_stop_backup complete, all required WAL segments have been archived
[2019-11-14 04:36:17] [NOTICE] copying configuration files from master
Host key verification failed.
Host key verification failed.
[2019-11-14 04:36:17] [ERROR] aborting, remote host DB1 is not reachable.
[2019-11-14 04:36:17] [ERROR] unable to take a base backup of the master server
[2019-11-14 04:36:17] [WARNING] destination directory (/var/lib/postgresql/9.5/main) may need to be cleaned up manually

First, I did clean the destination directory with the rm -rf command above

Second, I can access to DB1 database using on DB2

repmgr@DB2:~$ psql 'host=DB1 dbname=repmgr user=repmgr'
psql (9.5.19)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

repmgr=# 

I also put ssh key from repmgr and postgres user to other server.

So how to fix this problems, should I delete whole /var/lib/postgrest or do somethings esle ?

Bonus: Server 1 (DB1) already master

Role      | Connection String
* master  | host=DB1 user=repmgr dbname=repmgr connect_timeout=2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.