On the Replication Server
Setup the Docker Container
-
Download hview and its components from Docker Hub.
-
Edit the Docker Compose file and add the following mount volume to where the database will replicate to temporarily:
- Start the HView Database Component:
On the Primary Server
Log into the Current Production Server and Confirm the Following Settings
-
postgresql.conffile: -
Ensure the following settings are configured:
-
Allow the Replication Server to Connect to the Primary:
-
Update
pg_hba.confwith the following line: -
Restart the HView Database Container:
On the Replication Server
Execute the Backup Command to the Temp Mounted Store
- Run the following command to perform the backup:
screen docker exec -it hview.db pg_basebackup -h 10.20.5.190 -p 6976 -U hviewrep -X stream -C -S replica_1 -v -R -W -D /var/lib/postgresql/data2/
-
Stop the HView Database Container.
-
Move the old
/dbdirectory todb.original. -
Move the
db.newdirectory to thedbfolder. -
Start up the Replication Server.
-
Check the database container logs.
-
Confirm the replication status:
-
On the Master, run:
-
On the Replica (Streaming Replication in Our Case), run: