Re: 9.1 Streaming Replication - Mailing list pgsql-admin

From Devrim GÜNDÜZ
Subject Re: 9.1 Streaming Replication
Date
Msg-id 1355376936.2992.20.camel@lenovo01-laptop03.gunduz.org
Whole thread Raw
In response to 9.1 Streaming Replication  (Tony Nelson <tnelson@starpoint.com>)
List pgsql-admin
Hi,

On Thu, 2012-12-13 at 00:21 -0500, Tony Nelson wrote:

> I distribute wal segments to the targets using rsync.  One target is
> in the same rack as the primary, the other is a couple of states
> aways.  That seems to be working just fine.  What I can't seem to
> figure out is what they are used for?  The target servers seem to
> connect to the primary and sync from that, not from the wal logs.  Are
> they there in case of an extended disconnect?

When standby goes offline for a while (like you restart it), SR slave
tries to catch master first by replaying xlogs that have been
transferred to it, and then connects to walsender to get the new data.
That's why you need to transfer WAL segments.

> Also, when my target server comes up it always seems to complain that
> it can't find a wal archive.  It's always the one that is currently be
> written on the primary, that hasn't been archived yet.  Is that
> normal?

When standby comes up, it tries to read every not-applied WAL archive
first (as I wrote above), while looking for the next one to apply. If
next one is not available, then it tries to connect to walsender on
master node, and hopefully comes in sync with master.

That said, you may want to take a look at wal_keep_segments parameter,
if you haven't done already:

http://www.postgresql.org/docs/devel/static/runtime-config-replication.html

Regards,

<snip>

> Has anyone implemented a nagios monitor for these processes?

IIRC check_postgres (http://bucardo.org/wiki/Check_postgres) has a
monitoring stuff for this.

-HTH.

Regards,
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

Attachment

pgsql-admin by date:

Previous
From: Tony Nelson
Date:
Subject: 9.1 Streaming Replication
Next
From: Haifeng Liu
Date:
Subject: Confuse about the behaveior of PreparedStatement.executeBatch (jdbc)