Haute disponibilité ThingWorx > Exemple de déploiement d'une architecture HA PostgreSQL avec Pgpool-II > 7. Vérification de la réplication en streaming sur tous les noeuds
7. Vérification de la réplication en streaming sur tous les noeuds
Etape 1
Sur node0, redémarrez le service PostgreSQL.
Etape 2
Sur node1, synchronisez node1 avec node0 à l'aide du script start_replication, puis redémarrez PostgreSQL sur node1. L'adresse IP 10.91.9.200 est pour node0.
sudo su postgres
/db/bin/start_replication.sh 10.91.9.200
exit
sudo systemctl start postgresql-10.x
Etape 3
Sur node2, synchronisez node2 avec node1 à l'aide du script start_replication, puis redémarrez PostgreSQL sur node2. L'adresse IP 10.91.9.24 est pour node1.
sudo su postgres
/db/bin/start_replication.sh 10.91.9.24
exit
sudo systemctl start postgresql-10.x
Etape 4
Vérifiez le statut de la réplication.
Consultez les résultats de statut des processus PostgreSQL pour vérifier que la réplication est active.
sur 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
sur 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
sur 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
Dans les captures ci-dessus des statuts des processus, observez les points suivants pour vérifier que la réplication est en cours d'exécution :
node0 présente un processus émetteur et la cible de réplication est : 10.91.9.24 (node1).
node1 présente un processus émetteur et un processus récepteur.
node2 présente uniquement un processus récepteur.
Les trois noeuds sont synchronisés sur le flux 1A/BC0039A0.