Databases

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Automatic failover

https://repmgr.org/docs/4.0/repmgrd-basic-configuration.html#REPMGRD-AUTOMATIC-FAILOVER-CONFIGURATION

13.1.1. automatic failover configuration

If using automatic failover, the following repmgrd options must be set in repmgr.conf:

failover=automatic
promote_command='/usr/bin/repmgr standby promote -f /etc/repmgr.conf --log-to-file'
follow_command='/usr/bin/repmgr standby follow -f /etc/repmgr.conf --log-to-file --upstream-node-id=%n'

Adjust file paths as appropriate; we recomment specifying the full path to the repmgr binary.

Note that the --log-to-file option will cause output generated by the repmgr command, when executed by repmgrd, to be logged to the same destination configured to receive log output for repmgrd. See repmgr.conf.sample for further repmgrd-specific settings.

When failover is set to automatic, upon detecting failure of the current primary, repmgrd will execute one of:

promote_command (if the current server is to become the new primary)
follow_command (if the current server needs to follow another server which has become the new primary)

terraform state mv openstack_compute_instance_v2.databases[0] openstack_compute_instance_v2.databases[1]