1
0
mirror of https://github.com/coltoneshaw/CS-Repro-Mattermost.git synced 2025-12-23 18:11:34 +01:00

added initial setup of replicas

This commit is contained in:
coltoneshaw
2024-03-29 17:21:34 -04:00
parent 492130d846
commit 21fdbf5a37
13 changed files with 239 additions and 15 deletions

View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -e
echo "include '/files/postgres/replica/replica_config.conf'" >> /var/lib/postgresql/data/postgresql.conf
echo "include '/files/postgres/replica/replica_2/replica_2_config.conf'" >> /var/lib/postgresql/data/postgresql.conf
cp /var/lib/postgresql/data/postgresql.conf /files/postgres/replica/replica_2/baseconfig.conf
rm -rf /var/lib/postgresql/data/*
export PGPASSWORD='replicauser_password'
pg_basebackup -h cs-repro-postgres -p 5432 -U replicauser -D /var/lib/postgresql/data -Fp -Xs -R
rm -rf /var/lib/postgresql/data/postgresql.conf
cp /files/postgres/replica/replica_2/baseconfig.conf /var/lib/postgresql/data/postgresql.conf
exec pg_ctl -D /var/lib/postgresql/data start

View File

@@ -0,0 +1,3 @@
# replication slot on sending server
# This needs to be configured using the docs below for "Keeping the replica and primary in sync."
primary_slot_name = 'replica_2_slot'