DAP - Psql can not translate host name on follower or standby node
Symptom
Replication on standby or follower fails. The following appears in the logs:
psql: could not translate host name "master.fqdn.com" to address: Temporary failure in name resolution
psql: could not translate host name "master.fqdn.com" to address: Temporary failure in name resolution
error: Replication connection could not be established Environment
DAP v11 or higher
Cause
This is typically caused by IPv4 forwarding being disabled on the node. You can verify the status of IPv4 forwarding by running the following inside the container:
/sbin/sysctl net.ipv4.conf.all.forwarding
The above should return back a value of 1. If the result is 0, then IPv4 forwarding needs to be enabled on the underlying host.
Resolution
By default, traffic from containers connected to the default bridge network is not forwarded to the outside world. To enable forwarding, you need to change two settings. These are not Docker commands and they affect the Docker host’s kernel.
-
Configure the Linux kernel to allow IP forwarding.
$ sysctl net.ipv4.conf.all.forwarding=1 -
Change the policy for the
iptablesFORWARDpolicy fromDROPtoACCEPT.$ sudo iptables -P FORWARD ACCEPT
These settings do not persist across a reboot, so you may need to add them to a start-up script.