Question

I'm not a DBA but I have been tasked with setting up a database and streaming replication and repmgr is the tool I have decided to use.

The master goes on fine and I can see it registered in the cluster.

The error on the slave is as follows

[2016-07-22 15:39:35] [NOTICE] using configuration file "/etc/repmgr/repmgr.conf"
[2016-07-22 15:39:35] [NOTICE] destination directory '/var/lib/postgresql/9.4/main' provided
[2016-07-22 15:39:36] [ERROR] aborting, remote host xx.xxx.xxx.xxx is not reachable.
[2016-07-22 15:39:36] [ERROR] unable to drop replication slot "repmgr_slot_2":
ERROR:  replication slot "repmgr_slot_2" does not exist

[2016-07-22 15:39:36] [ERROR] unable to take a base backup of the master server
[2016-07-22 15:39:36] [WARNING] destination directory (/var/lib/postgresql/9.4/main) may need to be cleaned up manually

The command casuiging the abover error is

repmgr -f /etc/repmgr/repmgr.conf --force --rsync-only -h dbhost1 -d repmgr -U repmgr --verbose standby clone

The config file is as follows

cluster=test
node=2
node_name=db-002
use_replication_slots=1
conninfo='host=dbhost2 user=repmgr dbname=repmgr'
pg_bindir=/usr/lib/postgresql/9.4/bin

I have tried loging into the dbhost1/masrer from dbhost2/slave using

psql -h xx.xxx.xxx.xxx -p xxxx -d repmgr -U repmgr

and it works just fine so the pg_hba file in dbhost1/master is configured correctly using trust for authentication.

Was it helpful?

Solution

OK, I found the issue. I hadn't properly configured passwordless ssh login between my master and slave. So despite being able to login into my master from my slave the issue was it couldn't copy files because ssh wold require a password.

My only issue is error reporting is horrible for repmgr.

Following this guide I missed a very small step. Always make sure you test the login of ssh between both master and slave for passwordless login to ensure it was setup correctly.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top