Introduction
Dans ce laboratoire, vous apprendrez à configurer la réplication en flux (streaming replication) de PostgreSQL. Ce mécanisme transfère et applique en continu les enregistrements du journal WAL (Write-Ahead Logging) d'un serveur primaire vers un serveur réplique, assurant ainsi une synchronisation des données quasi en temps réel.
Vous configurerez une réplique en flux, vérifierez le délai (lag) et l'état de la réplication, interrogerez les données de la réplique et arrêterez la réplication en toute sécurité. Cela implique de préparer le serveur primaire en modifiant postgresql.conf
pour autoriser les connexions depuis la réplique, en définissant le wal_level
sur replica
, et en ajustant max_wal_senders
.
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
postgresql(("PostgreSQL")) -.-> postgresql/PostgreSQLGroup(["PostgreSQL"])
postgresql/PostgreSQLGroup -.-> postgresql/db_setup("Create New Database")
postgresql/PostgreSQLGroup -.-> postgresql/db_access("Connect To Database")
postgresql/PostgreSQLGroup -.-> postgresql/data_all("Select All Data")
postgresql/PostgreSQLGroup -.-> postgresql/db_status("Check Database Status")
postgresql/PostgreSQLGroup -.-> postgresql/db_drop("Drop Entire Database")
subgraph Lab Skills
postgresql/db_setup -.-> lab-550962{{"Réplication en Streaming PostgreSQL"}}
postgresql/db_access -.-> lab-550962{{"Réplication en Streaming PostgreSQL"}}
postgresql/data_all -.-> lab-550962{{"Réplication en Streaming PostgreSQL"}}
postgresql/db_status -.-> lab-550962{{"Réplication en Streaming PostgreSQL"}}
postgresql/db_drop -.-> lab-550962{{"Réplication en Streaming PostgreSQL"}}
end