For this recipe, we should already have three PostgreSQL servers. As before, we'll assume they are named pg1, pg2, and pg3. Follow these steps to fix the broken system:
- Remove the contents of the corrupt cluster by running the following command as the postgres user on the broken system:
rm -Rf /db/pgdata
- Start a new patroni daemon with this command as the postgres user:
patroni /etc/patroni/stampede.yml \ &> /var/log/postgresql/patroni.log &
- Follow the Patroni log with this command:
tail -f /var/log/postgresql/patroni.log