[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-admin
Subject:    Re: [ADMIN] Trying to use binary replication - from tutorial
From:       Evan Walter <ewalter () decisionanalyst ! com>
Date:       2011-10-17 15:26:45
Message-ID: CAOHVLOEvgvroUeN8o9eWQL+kVXVpPgBqQtJc9rp_bodBpKzwKw () mail ! gmail ! com
[Download RAW message or body]

Yes thank you.
I actually did get it working eventually, with the things you mentioned.
Also, the recovery.conf has to be in the directory that contains the data
folder!  I previously had it in the folder with the config files, which in
my installation are different.  Once I moved the recovery.conf (this was
actually figured out by a colleague), the replication was working
beautifully.

Thanks
Evan Walter

On Mon, Oct 17, 2011 at 10:20 AM, Mark Keisler <qa4437@motorola.com> wrote:

> 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@decisionanalyst.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@motorola.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@decisionanalyst.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
>>>>
>>>
>>>
>>
>

[Attachment #3 (text/html)]

Yes thank you.  <br>I actually did get it working eventually, with the things you \
mentioned.  Also, the recovery.conf has to be in the directory that contains the data \
folder!  I previously had it in the folder with the config files, which in my \
installation are different.  Once I moved the recovery.conf (this was actually \
figured out by a colleague), the replication was working beautifully.<br> \
<br>Thanks<br>Evan Walter <br><br><div style="margin:0pt" \
name="sig_d41d8cd98f"></div><div class="gmail_quote">On Mon, Oct 17, 2011 at 10:20 \
AM, Mark Keisler <span dir="ltr">&lt;<a \
href="mailto:qa4437@motorola.com">qa4437@motorola.com</a>&gt;</span> wrote:<br> \
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;">In your recovery.conf, you should also have a \
restore_command setting.  That&#39;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 :).<div> <div></div><div class="h5"><br>
<br><br clear="all"><br><br><div class="gmail_quote">On Thu, Oct 13, 2011 at 3:31 PM, \
Evan Walter <span dir="ltr">&lt;<a href="mailto:ewalter@decisionanalyst.com" \
target="_blank">ewalter@decisionanalyst.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> I pretty much didn&#39;t change anything in the config files \
except what was in the tutorial at <a \
href="http://wiki.postgresql.org/wiki/Binary_Replication_Tutorial" \
target="_blank">http://wiki.postgresql.org/wiki/Binary_Replication_Tutorial</a><br>


<br>on the slave I created a recovery.conf file containing:<br>standby_mode = \
&#39;on&#39;<br>primary_conninfo = &#39;host=&lt;servers ip here&gt;&#39;<br><br>on \
the master postgresql.conf I set<br>listen_address = &#39;*&#39;<br>


wav_level = hot_standby<br>max_wal_senders = 3<br><br>I didn&#39;t change any of \
postgresql.conf Archiving settings.  They all seem to be commented out.  Could that \
be the problem?<br><font color="#888888"><br>Evan <br></font><div>

<div></div><div><br><br><div class="gmail_quote">On Thu, Oct 13, 2011 at 3:19 PM, \
Mark Keisler <span dir="ltr">&lt;<a href="mailto:qa4437@motorola.com" \
target="_blank">qa4437@motorola.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">


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?<div><div>


</div><div><br>
<br><br><div class="gmail_quote">On Thu, Oct 13, 2011 at 10:41 AM, Evan Walter <span \
dir="ltr">&lt;<a href="mailto:ewalter@decisionanalyst.com" \
target="_blank">ewalter@decisionanalyst.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">



<br><br>Hello,<br>I am somewhat new with postgresql trying to find a good method of \
replication for my company.<br>I am running through the tutorials on binary \
replication for postgresql 9.1.  Both servers are virtual box Ubuntu 10.10 on a \
laptop. <br>




<br>I ran this rsync -av --exclude pg_xlog --exclude postgresql.conf \
/var/lib/postgresql/9.1/main/* postgres:&lt;ip-address of \
standby&gt;:/var/lib/postgresql/9.1/main/<br><br>The standby server then will not \
restart.  It says it is missing pg_xlog/0000000000 ...   files<br>




<br>I ran the rsync again not excluding the pg_xlog.  This time both servers restart \
but there doesn&#39;t seem to be any replication occurring.<br><br>I am curious why \
this is going on - why it didn&#39;t work excluding the pg_xlog.  Was there something \
wrong with my syntax?  Is there something I am missing not found in the tutorial? \
<br>




I will appreciate any help, advice.<br><br>Thank you,<br><font \
color="#888888"><br>Evan<br> </font></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic