Skip to content

Commit 4fbaf54

Browse files
committedOct 9, 2019
set wal_level to replica, hot_standby is deprecated
1 parent cb9db4d commit 4fbaf54

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed
 

‎db/pg.master.setup.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ echo "host replication all 0.0.0.0/0 md5" >>"$PGDATA/pg_hba.conf"
66

77
# postgresql.conf
88
cat >>${PGDATA}/postgresql.conf <<EOF
9-
wal_level = hot_standby
9+
wal_level = replica
1010
archive_mode = on
1111
archive_command = 'cd .'
1212
max_wal_senders = 8
@@ -17,4 +17,4 @@ EOF
1717
# create replication user
1818
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
1919
CREATE USER $PG_MASTER_REP_USER REPLICATION LOGIN CONNECTION LIMIT 100 ENCRYPTED PASSWORD '$PG_MASTER_REP_PASS';
20-
EOSQL
20+
EOSQL

‎db/pg.standby.setup.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,11 @@ while ! pg_basebackup -h ${PG_MASTER_HOST} -D ${PGDATA} -U ${PG_MASTER_REP_USER}
2626
sleep 0.1
2727
done
2828

29-
# postgresql.conf
30-
sed -i 's/wal_level = hot_standby/wal_level = replica/g' ${PGDATA}/postgresql.conf
31-
3229
# recovery.conf
3330
cat >${PGDATA}/recovery.conf <<EOF
3431
standby_mode = 'on'
3532
primary_conninfo = 'host=$PG_MASTER_HOST port=$PG_MASTER_PORT user=$PG_MASTER_REP_USER password=$PG_MASTER_REP_PASS'
36-
recovery_target_timeline='latest'
33+
recovery_target_timeline = 'latest'
3734
trigger_file = '/tmp/touch_me_to_promote_me_to_postgres_master'
3835
EOF
3936

0 commit comments

Comments
 (0)
Please sign in to comment.