Re: streaming replication

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Fujii Masao" <masao(dot)fujii(at)gmail(dot)com>,"Alex Lai" <alai(at)sesda2(dot)com>
Cc: "Vinay" <vinay(dot)dhoom(at)gmail(dot)com>, "Karuna Karpe" <karuna(dot)karpe(at)os3infotech(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: streaming replication
Date: 2011-11-07 17:10:03
Message-ID: 4EB7BC8B0200002500042AFF@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Alex Lai <alai(at)sesda2(dot)com> wrote:
> Fujii Masao wrote:

>> What about using rsync to take a base backup from new master and
>> load it onto old master? rsync can reduce the backup time by
>> sending only differences between those two servers.

> My postgres instance has two databases. The pg_dump size is about
> 30GB size. Rsync the entire $PGDATA take about an hour to a empty
> directory. When I rsync the $PGDATA to the existing directory, it
> still take 50 minutes. It seems to me that rsync still spend most
> of the time checking any changes even with very little changes.
> Maybe I miss some option when using rsync can speed up the update.

If the bottleneck is the network, be sure that you are using a
daemon on the remote side; otherwise you do drag all the data over
the wire for any file which doesn't have an identical timestamp and
size. An example of how to do that from the rsync man page:

rsync -av -e "ssh -l ssh-user" rsync-user(at)host::module /dest

This will try to identify matching portions of files and avoid
sending them over the wire.

-Kevin

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2011-11-07 17:16:06 Re: pg_dump from 8.4 to 8.3
Previous Message Kieren Scott 2011-11-07 16:54:01 pg_dump from 8.4 to 8.3