3

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

2 Answers 2

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>';
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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