Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 48E8D16CB03B for ; Mon, 7 Nov 2011 12:20:50 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 42297-08-2 for ; Mon, 7 Nov 2011 16:20:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sesda2.com (postman.sesda2.com [63.68.157.115]) by mail.postgresql.org (Postfix) with ESMTP id AF2B21EAD0A9 for ; Mon, 7 Nov 2011 12:13:11 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by sesda2.com (Postfix) with ESMTP id 1A86B8E4077; Mon, 7 Nov 2011 11:13:05 -0500 (EST) X-Virus-Scanned: amavisd-new at sesda2.com Received: from sesda2.com ([127.0.0.1]) by localhost (postman.sesda2.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7l1dgWFOOdIh; Mon, 7 Nov 2011 11:13:05 -0500 (EST) Received: from [192.168.200.162] (unknown [192.168.200.162]) by sesda2.com (Postfix) with ESMTP id F07548E4068; Mon, 7 Nov 2011 11:13:04 -0500 (EST) Message-ID: <4EB80391.1020809@sesda2.com> Date: Mon, 07 Nov 2011 11:13:05 -0500 From: Alex Lai User-Agent: Thunderbird 2.0.0.24 (X11/20110928) MIME-Version: 1.0 To: Fujii Masao CC: Karuna Karpe , Vinay , pgsql-admin@postgresql.org Subject: Re: streaming replication References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.381 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.201, SARE_SPEC_REPLICA=0.72 X-Spam-Level: X-Archive-Number: 201111/12 X-Sequence-Number: 38606 Fujii Masao wrote: > On Wed, Nov 2, 2011 at 4:48 PM, Karuna Karpe > wrote: > >> But I want huge amount of data in database. so it is take so much to take >> dump from slave db and load in master db. >> for example :- >> I have one master db server with 20GB of data and two slave db >> server are replicated from master server. when my master db server is fail, >> then one of slave server become new master server. In new master server >> 50MB of data add into database. After some time my failed(old) master back >> up, then I want to become my old master server as master and my new master >> server become slave(as previous setting). So please let me know that how >> replication only that 50MB data into old master database server???? >> > > 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. > > Regards, > > 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. -- Best regards, Alex Lai alai@sesda2.com