The following recipes will require that you have at least two database servers with internet connectivity for the purpose of testing. The commands that will be discussed in these recipes should work on the CentOS/Red Hat/OEL and Ubuntu/Debian family of operating systems. All the recipes in this chapter will be using the following hostnames and corresponding IP addresses. We need to replace the appropriate hostname and IP address that matches our PostgreSQL cluster:
pg1 192.168.10.1 (Primary or Master)
pg2 192.168.10.1 (Standby or Replica)
pg3 192.168.10.1 (Second Standby in some recipes)
Additionally, it's recommended that the hostnames and their IPs are set in the /etc/hosts file as the root user:
echo "192.168.10.1 pg1" >> /etc/hosts
echo "192.168.10.2 pg2" >> /etc/hosts
echo "192.168.10.3 pg3" >> /etc/hosts
Let's get started!