Re: Minimal streaming replication

From: Stuart Bishop <stuart(at)stuartbishop(dot)net>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Minimal streaming replication
Date: 2012-06-26 12:18:57
Message-ID: CADmi=6OGudLzU85Gq9SAh57k22zpm2goX-v+YwtN72hq7k2ZaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 26, 2012 at 6:47 AM, Steve Crawford
<scrawford(at)pinpointresearch(dot)com> wrote:

> The documentation says "To use streaming replication, set up a file-based
> log-shipping standby server as described in Section 25.2...." however I'm
> not using any of the archive or restore commands but instead use
> pg_basebackup to do the initial copy in a script that at its core runs
> pg_basebackup then starts the standby server. So...
>
> Given a sufficiently large wal_keep_segments on the master is this a
> reasonable approach?

Its what I've setup and seems to be working fine.

> Is there a disadvantage, other than disk-space required, to having
> wal_keep_segments set to a fairly large number, say 256 or 512?

I set mine to 5000.

> However I'm seeing troubling messages in the log. While running pgbench I
> see the following types of messages on the master every minute or few:

> 2012-06-25 11:36:26 PDT FATAL:  could not send data to WAL stream: SSL
> error: sslv3 alert unexpected message
> 2012-06-25 11:36:26 PDT LOG:  invalid magic number 0000 in log file 457,
> segment 173, offset 15851520
> ...
> 2012-06-25 11:36:41 PDT LOG:  streaming replication successfully connected
> to primary
> ...
>
> Any advice on what this is telling me? I'm not keen on words like "FATAL" in
> my logs.

I saw this with Ubuntu 12.04 and PostgreSQL 9.1.4, replicating to an
identical machine. Google suggested it was caused by different
versions of libssl, but I don't think that is the case here unless one
of the packages got statically linked with an old libssl. I haven't
had time to investigate so I've disabled SSL for now, even though
replication appears to work apart from the disconnections.

--
Stuart Bishop <stuart(at)stuartbishop(dot)net>
http://www.stuartbishop.net/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-06-26 13:19:55 Re: txid and current_timestamp
Previous Message Stuart Bishop 2012-06-26 12:11:56 Re: Calculating Replication Lag - units