4

How do I remove failed node from a PostgreSQL cluster?

postgres@db-prod-ms47ox-10-3-104-92:~$ repmgr -f /etc/repmgr/repmgr.conf cluster show
Role      | Connection String
* master  | host=db-prod-ms47ox-10-3-105-192.vandelay.io
  standby | host=db-prod-ms47ox-10-3-104-92.vandelay.io
  FAILED  | host=db-prod-lu8spc-10-3-104-145.vandelay.io

Running repmgr cluster cleanup does not remove this node and it appears to stop me from adding a new node into the cluster.

This is with repmgr 2.0 and postgres 9.1

mjallday
  • 171
  • 1
  • 6

2 Answers2

3

As stated in https://groups.google.com/forum/#!topic/repmgr/R7osmnYLn4g :

probably an UNREGISTER command is needed for that, for now... just delete the entry from repl_nodes

This is done by accessing the master node with the same connection details used by repmgr and issuing the following:

DELETE FROM repmgr_<cluster name>.repl_nodes WHERE name = '<name>';
S19N
  • 151
  • 5
2

There are now commands to remove failed nodes (repmgr 4.0 or newer)

  • repmgr primary unregister -f /etc/repmgr.conf --node-id=<id>
  • repmgr standby unregister -f /etc/repmgr.conf --node-id=<id>

More info:
https://repmgr.org/docs/current/repmgr-primary-unregister.html
https://repmgr.org/docs/current/repmgr-standby-unregister.html

Andrés
  • 21
  • 1