Re: streaming replication question

From: Rajesh Kumar Mallah <mallah(dot)rajesh(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: streaming replication question
Date: 2010-10-05 07:04:52
Message-ID: AANLkTikJ2OB7OPUsE98L5ZFH+Frse1-uGOMpyMgPOpsb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Oct 5, 2010 at 12:09 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:

> On Tue, Oct 5, 2010 at 2:57 AM, Rajesh Kumar Mallah
> <mallah(dot)rajesh(at)gmail(dot)com> wrote:
> > I am currently aiming to setup only SR between 2 servers only.
>
> "only SR" means that you don't need Hot Standby (i.e., you don't need to
> run any query on the standby server)? If so, you can set wal_level to
> archive instead of hot_standby, and disable hot_standby parameter on the
> standby.
>

Thanks for the kind replies,
May be I am mistaken in understanding of the terms. I do issue read only
queries to the standby server. So I think its HS. But I also stream the
wal records.

>
> > My question is in SR setup do i need to keep transferring the archived
> WAL
> > files also ?
>
> No if wal_keep_segments is high enough that WAL files required for the
> standby
> can be saved in pg_xlog directory of the master.
>
> > when the slave requests WAL records from the master does the master
> consult
> > the archived
> > wal files also for sending the records ?
>
> No. In 9.0, the master doesn't read and send the archived WAL files.
> But I agree to make the master send the archived WAL files, and I'm
> now proposing that.
> http://archives.postgresql.org/pgsql-hackers/2010-09/msg02040.php
>
> Regards,
>

I just wanted to let you know how i am now managing the wal logs.
i have mounted the wal archive folder(Xp) of primary on the slave via NFS to
a folder (Ys).
The folder Xp of primary is periodically rsynced to folder Xs on slave with
option --delete
in recovery.conf of slave archive_cleanup_command has been specified to
cleanup Ys
(not Xs), since it is a NFS rw mount it removes the unneeded archived WAL
files from the
source also ie Xp . subsequently the files are removed from Xs also because
of the
--delete option of rsync.

My original requirement is that , I should be able to divert certain amount
of Read Only
queries from the master to salve so as to reduce load in primary. Our pilot
applications
have been modified so that they always contact master when that have to
modify data
and slave when they have to read data. The current setup provides for the
requirement
but I am concerned what happens if the slave is shutdown for a prolonged
duration how
will i get to know when a base backup is required. I am trying to read the
docs and
practically observing also the effects of various steps. We have a switch in
the software
that lets was not to use the slave at all ! .

Regds
Rajesh Kumar Mallah.
Tradeindia.com - India's Largest B2B MarketPlace.
(uses PostgreSQL for past 10 years)

>
> --
> Fujii Masao
> NIPPON TELEGRAPH AND TELEPHONE CORPORATION
> NTT Open Source Software Center
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arjen Nienhuis 2010-10-05 07:26:54 Re: Question regarding custom parser
Previous Message Satoshi Nagayasu 2010-10-05 06:36:20 Re: Why would a scan take so long?

Browse pgsql-hackers by date

  From Date Subject
Next Message Massa, Harald Armin 2010-10-05 07:33:44 queriing the version of libpq
Previous Message Markus Wanner 2010-10-05 06:57:09 Re: standby registration (was: is sync rep stalled?)