Add postgres cluster replication smoke tests.

This commit is contained in:
Will Rouesnel
2016-11-17 00:58:25 +11:00
parent c00d3fb6e7
commit 8c0f2ed166
7 changed files with 296 additions and 9 deletions

View File

@@ -0,0 +1,22 @@
#!/bin/bash
if [ "x$REPLICATE_FROM" == "x" ]; then
cat >> ${PGDATA}/postgresql.conf <<EOF
wal_level = hot_standby
max_wal_senders = $PG_MAX_WAL_SENDERS
wal_keep_segments = $PG_WAL_KEEP_SEGMENTS
hot_standby = on
EOF
else
cat > ${PGDATA}/recovery.conf <<EOF
standby_mode = on
primary_conninfo = 'host=${REPLICATE_FROM} port=5432 user=${POSTGRES_USER} password=${POSTGRES_PASSWORD}'
trigger_file = '/tmp/touch_me_to_promote_to_me_master'
EOF
chown postgres ${PGDATA}/recovery.conf
chmod 600 ${PGDATA}/recovery.conf
fi