I am new to PostgreSQL, and I have a task of implementing replication and failover in PostgreSQL database. We are using 2 nodes (1st Primary and 2nd Slave). I have configured the streaming replication in them and it works fine. But now I am unable to configure the automatic failover in them. When the primary goes down the slave should be promoted as a primary.
I have tried Pgpool but after reading on some forums I dropped it, now planning to go for repmgr. Is repmgr a good solution? I also need a step by step configuration of failover in PostgreSQL with repmgr.
I have tried many scripts for failover but it seems to be not working. Can anyone provide me a sample script for failover process, and steps to how to execute them?