pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feed9.1.3: launching streaming replication
7+ messages / 3 participants
[nested] [flat]
* 9.1.3: launching streaming replication
@ 2012-04-02 21:21 Welty, Richard <rwelty@ltionline.com>
0 siblings, 1 reply; 7+ messages in thread
From: Welty, Richard @ 2012-04-02 21:21 UTC (permalink / raw)
To: pgsql-general@postgresql.org
i have a server in the ec2 cloud which in theory is set up as a master; it starts and runs. i've got an amazon s3 bucket mounted using s3fs on both the master and the standby (the standby is also set up in the ec2 cloud.)
i followed the steps here: http://wiki.postgresql.org/wiki/Streaming_Replication
and have the backup and the wal archive on the s3 bucket and they are both there.
when i go to start the hot standby, i pretty consistently get
LOG: entering standby mode
cp: cannot stat `/db-backup/wal_archive/000000010000000000000001': No such file or directory
WARNING: WAL was generated with wal_level=minimal, data may be missing
HINT: This happens if you temporarily set wal_level=minimal without taking a new base backup.
FATAL: hot standby is not possible because wal_level was not set to "hot_standby" on the master server
HINT: Either set wal_level to "hot_standby" on the master, or turn off hot_standby here.
LOG: startup process (PID 29938) exited with exit code 1
LOG: aborting startup due to startup process failure
and the startup of the hot standby fails. the Riggs admin cookbook says "you will need a short delay", but has no guesstimate on the length required. i don't even know if i'm seeing this problem or something else.
if i need to run a new backup, what cleanup do i need to do of old backups and wal_archives? could this be interfering with the startup of the standby? i've gone through several iterations and fixed some problems, and wonder if there's obsolete data that is messing things up?
thanks,
richard
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: 9.1.3: launching streaming replication
@ 2012-04-02 23:19 Michael Nolan <htfoot@gmail.com>
parent: Welty, Richard <rwelty@ltionline.com>
0 siblings, 2 replies; 7+ messages in thread
From: Michael Nolan @ 2012-04-02 23:19 UTC (permalink / raw)
To: Welty, Richard <rwelty@ltionline.com>; +Cc: pgsql-general@postgresql.org
On Mon, Apr 2, 2012 at 4:21 PM, Welty, Richard <rwelty@ltionline.com> wrote:
I got similar messages the first few times I tried to start up my slave
server, I never did figure out exactly what caused it.
You can either delete all the files on the slave and try again, or do what
I did, write a script that handles transferring just the files needed to
resync the slave.
Here's the script I've been using to transfer the files between my two
servers to resync them. This is not a production-ready script.
I have a second tablespace, so there are two 'data' transfers plus the xlog
transfer. (You may run into issues transferring the pg_tblspc directory,
as I did, hence the '-safe-links' parameter.) The '-delete' term deletes
any files on the slave that aren't on the server, unless you list them in
an '--exclude' clause.)
/usr/local/pgsql/bin/psql -c "select pg_start_backup('tardir',true)"
postgres postgres
rsync -av --exclude log.out --exclude postgresql.conf \
--exclude postgresql.pid --delete --exclude pg_hba.conf \
--exclude pg_xlog --exclude server.crt --exclude server.key \
--exclude restore.conf --exclude restore.done \
--safe-links /usr/local/pgsql/data/ postgres@xxx:/usr/local/pgsql/data
rsync -av /usr/local/pgsql/data2/ postgres@xxx:/usr/local/pgsql/data2
/usr/local/pgsql/bin/psql -c "select pg_stop_backup()" postgres postgres
rsync -av /usr/local/pgsql/data/pg_xlog postgres@xxx:/usr/local/pgsql/data/
echo "ok to start standby"
--
Mike Nolan
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: 9.1.3: launching streaming replication
@ 2012-04-02 23:29 Michael Nolan <htfoot@gmail.com>
parent: Michael Nolan <htfoot@gmail.com>
1 sibling, 0 replies; 7+ messages in thread
From: Michael Nolan @ 2012-04-02 23:29 UTC (permalink / raw)
To: Welty, Richard <rwelty@ltionline.com>; +Cc: pgsql-general@postgresql.org
On Mon, Apr 2, 2012 at 6:19 PM, Michael Nolan <htfoot@gmail.com> wrote:
>
>
>
> I got similar messages the first few times I tried to start up my slave
> server, I never did figure out exactly what caused it.
>
>
One possibility is that I may not have restarted the master server after
changing the postgresql.conf file, thus the server still didn't know it was
going into hot-standby mode.
--
Mike Nolan
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: 9.1.3: launching streaming replication
@ 2012-04-03 15:42 Welty, Richard <rwelty@ltionline.com>
parent: Michael Nolan <htfoot@gmail.com>
1 sibling, 1 reply; 7+ messages in thread
From: Welty, Richard @ 2012-04-03 15:42 UTC (permalink / raw)
To: Michael Nolan <htfoot@gmail.com>; +Cc: pgsql-general@postgresql.org
thanks for the suggestions. the light has gone on and i have it working as of about 15 minutes ago. i'm going to revisit the documentation and possibly make suggestions about making things a little clearer, or else issue a mea culpa about my reading comprehension. don't know which just yet.
richard
-----Original Message-----
From: Michael Nolan [mailto:htfoot@gmail.com]
Sent: Mon 4/2/2012 7:19 PM
To: Welty, Richard
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] 9.1.3: launching streaming replication
On Mon, Apr 2, 2012 at 4:21 PM, Welty, Richard <rwelty@ltionline.com> wrote:
I got similar messages the first few times I tried to start up my slave
server, I never did figure out exactly what caused it.
You can either delete all the files on the slave and try again, or do what
I did, write a script that handles transferring just the files needed to
resync the slave.
Here's the script I've been using to transfer the files between my two
servers to resync them. This is not a production-ready script.
I have a second tablespace, so there are two 'data' transfers plus the xlog
transfer. (You may run into issues transferring the pg_tblspc directory,
as I did, hence the '-safe-links' parameter.) The '-delete' term deletes
any files on the slave that aren't on the server, unless you list them in
an '--exclude' clause.)
/usr/local/pgsql/bin/psql -c "select pg_start_backup('tardir',true)"
postgres postgres
rsync -av --exclude log.out --exclude postgresql.conf \
--exclude postgresql.pid --delete --exclude pg_hba.conf \
--exclude pg_xlog --exclude server.crt --exclude server.key \
--exclude restore.conf --exclude restore.done \
--safe-links /usr/local/pgsql/data/ postgres@xxx:/usr/local/pgsql/data
rsync -av /usr/local/pgsql/data2/ postgres@xxx:/usr/local/pgsql/data2
/usr/local/pgsql/bin/psql -c "select pg_stop_backup()" postgres postgres
rsync -av /usr/local/pgsql/data/pg_xlog postgres@xxx:/usr/local/pgsql/data/
echo "ok to start standby"
--
Mike Nolan
^ permalink raw reply [nested|flat] 7+ messages in thread
* Fwd: [GENERAL] 9.1.3: launching streaming replication
@ 2012-04-03 22:21 Michael Nolan <htfoot@gmail.com>
parent: Welty, Richard <rwelty@ltionline.com>
0 siblings, 1 reply; 7+ messages in thread
From: Michael Nolan @ 2012-04-03 22:21 UTC (permalink / raw)
To: ; +Cc: pgsql-docs
---------- Forwarded message ----------
From: Welty, Richard <rwelty@ltionline.com>
Date: Tue, Apr 3, 2012 at 5:33 PM
Subject: RE: [GENERAL] 9.1.3: launching streaming replication
To: Michael Nolan <htfoot@gmail.com>
**
>you may want to do something with the other, then, as it's what came up
when i went searching >for help.
to amplify, the other page comes up first in a google search for
"postgresql streaming replication" which is how i found it.
richard
Not sure how I found the other page first, but I'll look at that page, it
looks like it hasn't been updated for 9.1 yet, either. It also doesn't
show up in the topic category page for replication.
http://wiki.postgresql.org/wiki/Category:Replication
I don't how to update that one (or if that's left up to the
administrators), so I'm sending this note on to the pgsql-docs list as well.
--
Mike Nolan
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Fwd: [GENERAL] 9.1.3: launching streaming replication
@ 2012-04-03 23:30 Greg Smith <greg@2ndQuadrant.com>
parent: Michael Nolan <htfoot@gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Greg Smith @ 2012-04-03 23:30 UTC (permalink / raw)
To: pgsql-docs; htfoot@gmail.com
On 04/03/2012 06:21 PM, Michael Nolan wrote:
>
> From: *Welty, Richard* <rwelty@ltionline.com <mailto:rwelty@ltionline.com>>
> to amplify, the other page comes up first in a google search for
> "postgresql streaming replication" which is how i found it.
>
> Not sure how I found the other page first, but I'll look at that page,
> it looks like it hasn't been updated for 9.1 yet, either. It also
> doesn't show up in the topic category page for replication.
> http://wiki.postgresql.org/wiki/Category:Replication
Mike already fixed the category problem himself. I just updated
http://wiki.postgresql.org/wiki/Streaming_Replication so that it
suggests users visit the official docs and tutorial on the wiki, since
we can't just make Google unlike that page easily.
P.S. Mike: please fill in the "Summary" box about what you're changing
when you update wiki content, or click the "This is minor edit" box if
there's no serious content change. Streams of edits with no description
are hard to tell from spam.
--
Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Fwd: [GENERAL] 9.1.3: launching streaming replication
@ 2012-04-04 15:18 Michael Nolan <htfoot@gmail.com>
parent: Greg Smith <greg@2ndQuadrant.com>
0 siblings, 0 replies; 7+ messages in thread
From: Michael Nolan @ 2012-04-04 15:18 UTC (permalink / raw)
To: Greg Smith <greg@2ndquadrant.com>; +Cc: pgsql-docs
On Tue, Apr 3, 2012 at 7:30 PM, Greg Smith <greg@2ndquadrant.com> wrote:
> Mike already fixed the category problem himself. I just updated
> http://wiki.postgresql.org/wiki/Streaming_Replication so that it suggests
> users visit the official docs and tutorial on the wiki, since we can't just
> make Google unlike that page easily.
>
Greg, there's sort of an inconsistency between the developer-oriented
streaming replication page and the tutorial.
The streaming replication page says to copy the entire data directory,
which would include the WAL logs in the pg_xlog directory. The 5 minute
version in the binary replication tutorial skips that directory, the longer
one copies it separately, after the backup is complete, so that the slave
can perform any committed changes as part of syncing up with the master.
I assume that there is no harm in copying the pg_xlog directory in the 5
minute version, and it was left out as a time-saver. However, if the
master fails and the slave has to take over, wouldn't it need the pg_xlog
directory? If it hasn't been created, could that cause problems or would
the backend know to create it?
--
Mike Nolan
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2012-04-04 15:18 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-04-02 21:21 9.1.3: launching streaming replication Welty, Richard <rwelty@ltionline.com>
2012-04-02 23:19 ` Michael Nolan <htfoot@gmail.com>
2012-04-02 23:29 ` Michael Nolan <htfoot@gmail.com>
2012-04-03 15:42 ` Welty, Richard <rwelty@ltionline.com>
2012-04-03 22:21 ` Michael Nolan <htfoot@gmail.com>
2012-04-03 23:30 ` Greg Smith <greg@2ndQuadrant.com>
2012-04-04 15:18 ` Michael Nolan <htfoot@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox