Re: WAL shipping replication server re-sync

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bosco Rama <postgres(at)boscorama(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: WAL shipping replication server re-sync
Date: 2011-06-10 03:43:11
Message-ID: 201106100343.p5A3hBu25748@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bosco Rama wrote:
> Hey folks,
>
> We're using PG 8.4.7 on two servers that are geographically
> distant from each other. We run WAL-shipping replication
> (i.e. constant recovery mode replication) between the two
> servers. These are the only two servers involved in the
> setup. When we do the 'fail-over' to swap the master and
> slave servers we perform the usual recovery trigger for
> pg_standby and then wait. The slave now becomes the master
> and the master becomes the new slave. This works great.
>
> When the servers flip modes we have been following the
> guidelines that say to clear the WAL logs and the main data
> area of the slave and copy the data area of the new master
> to the slave while the master is in 'backup' mode. Given
> the current size (17GB) of this data area and the bandwidth
> limits of the 'inter-tubes', this takes a rather long time.
> (4.5 hrs last time)
>
> Here's my (naive?) question: Since the two servers were
> essentially 'in sync' immediately prior to the switch-
> over is it possible to simply rsync the new master's data area
> back to the new slave's data area without clearing the slave's
> data area first? Or is the directory and file structure
> sufficiently different (even if the logical data is identical)
> to preclude this?
>
> Could this difference be alleviated by using the various 'delete
> on destination' options for rsync?

[ late reply]

Yes, you can use rsync, but only if both db servers are shut down.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arash pajoohande 2011-06-10 07:04:18 Re: what is the best way of storing text+image documents in postgresql
Previous Message Clemens Schwaighofer 2011-06-10 01:05:24 Re: plpgsql function with update and seeing changed data from outside during run