For this recipe, we should already have three PostgreSQL servers. As usual, we'll assume they are named pg1, pg2, and pg3. If pg2 is the current primary, follow these steps to simulate a server failure:
- Execute the following command as the postgres user on pg2:
pkill -f patroni
- Follow the Patroni log on pg1 or pg3 with this command:
tail -f /var/log/postgresql/patroni.log