I'm using using a cluster with 2 psql servers. I'm using repmgr to manage replication and failover.
Replication works fine, and when my master fail, the standby takes the lead. My problem is when I try to reup master as a slave. I use this commands:
rm -rf /var/lib/postgresql/9.6/main/*
repmgr -h acms-preprod-sql2 -U repmgr -p 5433 -d repmgr -D /var/lib/postgresql/9.6/main standby clone
cp /var/lib/postgresql/recovery.template /var/lib/postgresql/9.6/main/recovery.conf //recovery file for this node
service postgresql start
repmgr standby register --force --wait-sync
repmgrd -d --verbose >> /var/log/postgresql/repmgr.log 2>&1
But when I run the last command, I receive this message:
[ERROR] This node is marked as inactive and cannot be used for failover
But when I try a cluster show, this node is register as stanby and is running So I don't understand wat's happening