Re: Trying to use binary replication - from tutorial

From: Mark Keisler <qa4437(at)motorola(dot)com>
To: Evan Walter <ewalter(at)decisionanalyst(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: Trying to use binary replication - from tutorial
Date: 2011-10-17 15:20:02
Message-ID: CAGNWxWq7Q66FFypOb6dnEXumNGE=ybUamMHk6CazKk8gHY-1gQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

In your recovery.conf, you should also have a restore_command setting.
That's what the standby postgres will use to grab the archived WAL logs from
the master and it needs to. So yes, you need archive set to on and an
archive_command command setting on the master. You at least need that for
catching up from whatever happened between the pg_start_backup, rsync from
master to standby, then pg_stop_backup before it can start streaming
replication. Those steps are in the tutorial you have mentioned :).

On Thu, Oct 13, 2011 at 3:31 PM, Evan Walter <ewalter(at)decisionanalyst(dot)com>wrote:

> I pretty much didn't change anything in the config files except what was in
> the tutorial at
> http://wiki.postgresql.org/wiki/Binary_Replication_Tutorial
>
> on the slave I created a recovery.conf file containing:
> standby_mode = 'on'
> primary_conninfo = 'host=<servers ip here>'
>
> on the master postgresql.conf I set
> listen_address = '*'
> wav_level = hot_standby
> max_wal_senders = 3
>
> I didn't change any of postgresql.conf Archiving settings. They all seem
> to be commented out. Could that be the problem?
>
> Evan
>
>
> On Thu, Oct 13, 2011 at 3:19 PM, Mark Keisler <qa4437(at)motorola(dot)com> wrote:
>
>> Do not rsync the pg_xlog. Basically that error means that the
>> restore_command in your recovery.conf is not working. You have hot_standby
>> archiving going on the master and a recovery_command on the slave, right?
>>
>>
>>
>> On Thu, Oct 13, 2011 at 10:41 AM, Evan Walter <
>> ewalter(at)decisionanalyst(dot)com> wrote:
>>
>>>
>>>
>>> Hello,
>>> I am somewhat new with postgresql trying to find a good method of
>>> replication for my company.
>>> I am running through the tutorials on binary replication for postgresql
>>> 9.1. Both servers are virtual box Ubuntu 10.10 on a laptop.
>>>
>>> I ran this rsync -av --exclude pg_xlog --exclude postgresql.conf
>>> /var/lib/postgresql/9.1/main/* postgres:<ip-address of
>>> standby>:/var/lib/postgresql/9.1/main/
>>>
>>> The standby server then will not restart. It says it is missing
>>> pg_xlog/0000000000 ... files
>>>
>>> I ran the rsync again not excluding the pg_xlog. This time both servers
>>> restart but there doesn't seem to be any replication occurring.
>>>
>>> I am curious why this is going on - why it didn't work excluding the
>>> pg_xlog. Was there something wrong with my syntax? Is there something I am
>>> missing not found in the tutorial?
>>> I will appreciate any help, advice.
>>>
>>> Thank you,
>>>
>>> Evan
>>>
>>
>>
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Evan Walter 2011-10-17 15:26:45 Re: Trying to use binary replication - from tutorial
Previous Message Simon Riggs 2011-10-17 14:28:08 Re: after failover?

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-10-17 15:23:19 Re: Mac OS X 10.6 - libpq.dylib vs. libpq.a and PQisthreadsafe()
Previous Message Merlin Moncure 2011-10-17 14:24:13 Re: plpgsql; execute query inside exists