This recipe essentially comes in two parts, consisting of three configuration changes and a management script. All of the configuration settings related to standby disconnection handling are prefixed with child_. There are several of these, but for a cluster of this design where there is one primary, one standby, and one witness, we only really need to modify three of them.
The first two parameters are fairly closely related. We begin by setting the child_nodes_connected_min_count option to 1, which reflects our desire for at least one node to always be connected to the primary. However, witness nodes are not considered part of this count unless we also enable the child_nodes_connected_include_witness option. In a cluster ...