File tree 2 files changed +3
-6
lines changed
2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ echo "host replication all 0.0.0.0/0 md5" >>"$PGDATA/pg_hba.conf"
6
6
7
7
# postgresql.conf
8
8
cat >> ${PGDATA} /postgresql.conf << EOF
9
- wal_level = hot_standby
9
+ wal_level = replica
10
10
archive_mode = on
11
11
archive_command = 'cd .'
12
12
max_wal_senders = 8
17
17
# create replication user
18
18
psql -v ON_ERROR_STOP=1 --username " $POSTGRES_USER " --dbname " $POSTGRES_DB " << -EOSQL
19
19
CREATE USER $PG_MASTER_REP_USER REPLICATION LOGIN CONNECTION LIMIT 100 ENCRYPTED PASSWORD '$PG_MASTER_REP_PASS ';
20
- EOSQL
20
+ EOSQL
Original file line number Diff line number Diff line change @@ -26,14 +26,11 @@ while ! pg_basebackup -h ${PG_MASTER_HOST} -D ${PGDATA} -U ${PG_MASTER_REP_USER}
26
26
sleep 0.1
27
27
done
28
28
29
- # postgresql.conf
30
- sed -i ' s/wal_level = hot_standby/wal_level = replica/g' ${PGDATA} /postgresql.conf
31
-
32
29
# recovery.conf
33
30
cat > ${PGDATA} /recovery.conf << EOF
34
31
standby_mode = 'on'
35
32
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'
37
34
trigger_file = '/tmp/touch_me_to_promote_me_to_postgres_master'
38
35
EOF
39
36
You can’t perform that action at this time.
0 commit comments