I'd like to have some advice on the steps I have to follow to conduct a DR drill for below PostgreSQL setup.
Environment Setup
I have 2 PostgreSQL servers in my production environment which are clustered using pgpool. ( reference: https://www.pgpool.net/docs/42/en/html/example-cluster.html - I am using a scaled down setup with 2 nodes )
In my DR environment, I have a separate single PostgreSQL server which replicates data from node 1 in production environment. The WAL streaming is used to implement the replication from production's node 1 to DR.
postgresql version - 13 pgpool version - 4.2
DR Drill Activity
Phase 1: In the failover phase of the DR drill, the production PostgreSQL servers will be stopped and traffic will be switched to DR environment.
Phase 2: In the fall back phase of the DR drill, the production PostgreSQL servers will be started back and traffic will be switched back to the production environment. Before switching back the traffic, the production PostgreSQL cluster should have updated data records.
Questions
Q1: During the failover phase of the DR drill, how can I enable DR's PostgreSQL server to accepts write requests? ( currently, the DR is only supporting read requests )
Q2: In the fallback phase, the production's PostgreSQL cluster should be restored with latest data from DR. How can I achieve this? I'm also doubtful on the high level steps that I should follow during the fallback phase.
Thanks in advance.