Réplication Maitre-esclave sur un serveur de Base de Données Postgresql (AWS Ec2 instance- RedHat 8)

Contexte Général

Description

Prérequis

Étape de Mise en œuvre

#postgressql-setup initdb
#systemctl enable postgresql
#systemctl start postgresql
#su - postgres
$psql
ALTER SYSTEM SET listen_addresses TO 'localhost,172.31.14.55';
alter system set wal_level = replica;
alter system set max_wal_senders = 2;
alter system set max_wal_size = '200MB';
alter system set wal_keep_segments = 8;
alter system set hot_standby = on;
alter system set hot_standby_feedback = on;
set variable on postgresql.conf file
select pg_reload_conf();
CREATE USER replicator REPLICATION LOGIN CONNECTION LIMIT 5 ENCRYPTED PASSWORD 'xxx##Pa$$word';
host    replication   replicator  172.31.44.125/32  md5
systemctl restart postgresql
#su - postgres
$mv data data_old
$pg_basebackup -h 172.31.14.55 -D /var/lib/pgsql/data -U replicator -P -v -R
systemctl restart postgresql

Cloud / Cybersecurity enthusiast. CehV10, RHCSA, RHCE, Comptia Sec +, ITF +, AWS Architect

Cloud / Cybersecurity enthusiast. CehV10, RHCSA, RHCE, Comptia Sec +, ITF +, AWS Architect