Skip to content

Commit 4fb8baf

Browse files
author
Josh Berkus
committed
Fixed bugs with failover/failback exercise
1 parent 3230110 commit 4fb8baf

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tutorial/exercises.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ Failover and Failback
160160
runbench.sh
161161
^b n
162162
pg_ctl -D master -m immediate stop
163+
^b n
164+
^b n
163165
pg_ctl -D replica1 promote
164166
ls replica1/
165167
psql -p 5433
@@ -169,15 +171,9 @@ create table test2(test text);
169171
^b n
170172
runbench_replica1.sh
171173
^b n
172-
cp replica1/recovery.done master/recovery.conf
173-
$EDITOR master/recovery.conf
174-
pg_ctl -D master start
175-
psql -p 5433
176-
select * from pg_stat_replication;
177-
\q
178-
tail -f /var/log/postgresql/postgresql-master
179174
rm -rf master/*
180175
pg_basebackup -x -P -p 5433 -U replicator -D master
176+
cp /setup/postgres/master/* master/
181177
cp replica1/recovery.done master/recovery.conf
182178
$EDITOR master/recovery.conf
183179
pg_ctl -D master start
@@ -189,9 +185,11 @@ touch master/PROMOTE
189185
psql -p 5432
190186
select pg_is_in_recovery();
191187
\q
188+
pg_ctl -D replica1 -m immedate stop
192189
rm -rf replica1/*
193190
pg_basebackup -x -P -p 5432 -U replicator -D replica1
194191
cp /setup/postgres/replica1/* replica1/
192+
cp replica1/recovery.conf.replica1.dual replica1/recovery.conf
195193
pg_ctl -D replica1 start
196194
psql -p 5432
197195
select * from pg_stat_replication;

0 commit comments

Comments
 (0)