7. Verify streaming replication to all nodes
Step 1
On node0, restart PostgreSQL service.
Step 2
On node1, synchronize node1 with node0 using the start_replication script, then restart PostgreSQL on node1. The IP address of 10.91.9.200 is for node0.
sudo su postgres
/db/bin/start_replication.sh 10.91.9.200
exit
sudo systemctl start postgresql-10.x
Step 3
On node2, synchronize node2 with node1 using the start_replication script, then restart PostgreSQL on node 2. The IP address of 10.91.9.24 is for node1.
sudo su postgres
/db/bin/start_replication.sh 10.91.9.24
exit
sudo systemctl start postgresql-10.x
Step 4
Check replication status.
Review PostgreSQL processes status results to verify replication is active.
On node0:
[ec2-user@ip-10-91-9-200 ~]$ ps -ef|grep postgres
postgres 837 1 0 14:39 ? 00:00:00 /usr/pgsql-10.x/bin/postgres -D /db/postgres
postgres 863 837 0 14:39 ? 00:00:00 postgres: logger process
postgres 878 837 0 14:39 ? 00:00:00 postgres: checkpointer process
postgres 879 837 0 14:39 ? 00:00:00 postgres: writer process
postgres 880 837 0 14:39 ? 00:00:00 postgres: wal writer process
postgres 881 837 0 14:39 ? 00:00:00 postgres: autovacuum launcher process
postgres 882 837 0 14:39 ? 00:00:00 postgres: archiver process
postgres 883 837 0 14:39 ? 00:00:00 postgres: stats collector process
postgres 910 837 0 14:39 ? 00:00:00 postgres: wal sender process replicator 10.91.9.24(48264) streaming 1A/BC0039A0
on node1:
[ec2-user@ip-10-91-9-24 ~]$ ps -ef|grep postgres
postgres 834 1 0 14:39 ? 00:00:00 /usr/pgsql-10.x/bin/postgres -D /db/postgres
postgres 861 834 0 14:39 ? 00:00:00 postgres: logger process
postgres 863 834 0 14:39 ? 00:00:00 postgres: startup process recovering 000000170000001A000000BC
postgres 897 834 0 14:39 ? 00:00:00 postgres: checkpointer process
postgres 898 834 0 14:39 ? 00:00:00 postgres: writer process
postgres 899 834 0 14:39 ? 00:00:00 postgres: stats collector process
postgres 1236 834 0 14:39 ? 00:00:00 postgres: wal sender process replicator 10.91.9.41(48620) streaming 1A/BC0039A0
postgres 1279 834 0 14:39 ? 00:00:05 postgres: wal receiver
on node2:
[ec2-user@ip-10-91-9-41 ~]$ ps -ef|grep postgres
postgres 837 1 0 14:39 ? 00:00:00 /usr/pgsql-10.x/bin/postgres -D /db/postgres
postgres 859 837 0 14:39 ? 00:00:00 postgres: logger process
postgres 860 837 0 14:39 ? 00:00:00 postgres: startup process recovering 000000170000001A000000BC
postgres 887 837 0 14:39 ? 00:00:00 postgres: checkpointer process
postgres 888 837 0 14:39 ? 00:00:00 postgres: writer process
postgres 889 837 0 14:39 ? 00:00:00 postgres: stats collector process
postgres 890 837 0 14:39 ? 00:00:07 postgres: wal receiver
From the above captures of process status, observe the following to verify replication is up and running:
node0 has one sender process and replication target is: 10.91.9.24 (node1).
node1 has one sender process and one receiver process.
node2 has only one receiver process.
All three nodes are synchronized at stream 1A/BC0039A0
Was this helpful?