Re: Having trouble configuring a Master with multiple standby Servers in PostgreSQL 9.3.3 - Mailing list pgsql-bugs

From
Subject Re: Having trouble configuring a Master with multiple standby Servers in PostgreSQL 9.3.3
Date
Msg-id 20140418082452.5a830134ae84016b0174832fdc1a3173.8430ba0028.wbe@email11.secureserver.net
Whole thread Raw
List pgsql-bugs
<span style=3D"font-family:Verdana; color:#000000; font-size:10=
pt;">I started the recovery yesterday and it ran overnight and is stil=
l running. Is the problem that the master is still producing new archivelog=
s that the slave is trying to recover, so that I am currently in a perpetua=
l recovery mode?I can see that the most recent archivelog being =
processed on the master is also being recovered on the slave. Do I need to =
suspend copying the archivelogs to the /mnt/server/slave1_archivedir/ direc=
tory, or should I wait?thanks</div=
>Freddie=0A<blockquote id=3D"r=
eplyBlockquote" webmail=3D"1" style=3D"border-left: 2px solid blue; margin-=
left: 8px; padding-left: 8px; font-size:10pt; color:black; font-family:verd=
ana;">=0A=0A-------- Original Message --------<b=
r>=0ASubject: Re: [BUGS] Having trouble configuring a Master with multiple<=
br>=0Astandby Servers in PostgreSQL 9.3.3=0AFrom: Michael Paquier <<=
a href=3D"mailto:michael.paquier@gmail.com">michael.paquier@gmail.com&g=
t;=0ADate: Thu, April 17, 2014 5:28 pm=0ATo: <a href=3D"mailto:fbur=
gess@radiantblue.com">fburgess@radiantblue.com=0ACc: <a href=3D"mai=
lto:pgsql-bugs@postgresql.org">pgsql-bugs@postgresql.org=0A=0AO=
n Fri, Apr 18, 2014 at 1:19 AM,  <<a href=3D"mailto:fburgess@radiantblue=
.com">fburgess@radiantblue.com> wrote:=0A> Hi Michael, thanks=
 for your reply.=0A>=0A> I discussed this my colleague, and w=
e decided to change the archive_command=0A> to execute a shell scrip=
t.=0AThat's wiser as it allows more flexibility.=0A=0A> This=
 will copy the archivelogs from the master to both slaves. Will that=0A=
> avoid the issue with removing needed WAL files?=0A> slave 1=
=0A> archive_cleanup_command =3D 'pg_archivecleanup /mnt/server/slave1_a=
rchivedir/=0A> %r'=0A> slaves #2=0A> archive_cleanup_c=
ommand =3D 'pg_archivecleanup /mnt/server/slave2_archivedir/=0A> %r'=
=0A> Does this look correct?=0ALooks fine. You are copying each =
WAL file to a different archive=0Afolder, and pg_archivecleanup will cl=
ean only the path it uses for=0Aeach folder, so there is no risk to hav=
e a WAL file removed by one=0Aslave and needed by the other.=0A=
=0A> I did a pg_clt reload to change the archivelog destination from=
=0A> /mnt/server/master_archivedir to be redistributed to slave1 and sla=
ve2. Do I=0A> need to redo this backup step?=0ANot if the slaves=
 have already fetched necessary WAL files from the=0Asingle master arch=
ive before you changed the command.=0A=0A> psql -c "select pg_st=
art_backup('initial_backup');"=0A> rsync -cvar --inplace --exclude=
=3D*pg_xlog*=0A> /u01/fiber/postgreSQL_data/postgres@1.2.3.5:/u01/fi=
ber/postgreSQL_data/=0A> psql -c " select pg_stop_backup ();"=0A=
>=0A> or can I just copy all of the missing archivelog files from=
 the=0A> /mnt/server/master_archivedir to the slaves, and then resta=
rt the slaves in=0A> recovery mode?=0ATaking a new base backup w=
ill be fine. But you actually do not need to=0Ado so if your slaves hav=
e already caught up enough. Your slaves are=0Ausing streaming replicati=
on and are on the same server as the master=0AAFAIU so they should be f=
ine, but there is always a possibility that=0Athey need some WAL from a=
rchives if one of them for example was not=0Aable to connect to the mas=
ter for a long time and master already=0Adropped the necessary WAL file=
s from its pg_xlog.=0A-- =0AMichael=0A=0A=0A-- =0AS=
ent via pgsql-bugs mailing list (<a href=3D"mailto:pgsql-bugs@postgresql.or=
g">pgsql-bugs@postgresql.org)=0ATo make changes to your subscriptio=
n:=0Ahttp://w=
ww.postgresql.org/mailpref/pgsql-bugs=0A=0A=0A</=
span>

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #9136: pg_is_xlog_replay_paused() should not need Superuser
Next
From: Matheus de Oliveira
Date:
Subject: Re: BUG #9136: pg_is_xlog_replay_paused() should not need Superuser