0

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.

  • Given that you have specified -p with your psql command, are you using non-standard port numbers? If so, may be you need to also specify the port number in conninfo? Just a guess. – mustaccio Jul 22 '16 at 18:12
  • i don't think that is the problem as per the instruction the slave db should be off at this point and the remote server is what appears to be unreachable in the logs despite being able to reach it from the slave from psql. Any other ideas? – sqwale Jul 23 '16 at 9:53
0

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.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.