Re: Streaming Replication - changing IP addresses

From: Dara Unglaube <dara(at)glifwc(dot)org>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Streaming Replication - changing IP addresses
Date: 2014-12-09 17:07:23
Message-ID: CA+ca-roj3E2rJCws_muU6ruy=7n3bOKi9f7DxbEFOJ+rX4uZiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank so very for the info, John! This will help a lot to have it set up
locally.

I have it set up across the local network and double checked with
pg_stat_replication and it was using the local IP. But now I am not sure
about the "archive_command" command on the master. We had it set up to
archive onto the slave through the archive_command using SSH & rsync
because we were going through the public IP. Below is the command line.

archive_command = 'rsync -az -e "\"/cygdrive/c/cygwin64/bin/ssh.exe\""
"/cygdrive/d/PostgreSQL/9.1/data/%p"
"postgres(at)0(dot)0(dot)0(dot)0:/cygdrive/d/PostgreSQL/9.1/data/wals/%f"
'

Is this neccessary? What is the benefit of having the archive on? Could I
map a network drive from the slave to the master and set the
archive_command to that mapped drive? Or what would be the best approach
for this?

Thanks so very much!
Dara

On Mon, Dec 8, 2014 at 2:11 PM, John R Pierce <pierce(at)hogranch(dot)com> wrote:

> On 12/8/2014 11:56 AM, Dara Unglaube wrote:
>
> We have streaming replication set up on two servers that are on our local
> network using their external/public IP addresses. We are switching internet
> providers and need to change the external/public IP addresses of both
> servers. I'm not sure how to go about this correctly.
>
> 1. Our local network IP addresses will not be changing, is there any
> reason we could/should not use our local network IP addresses in the
> streaming replication process?
> 2. What is the best route to make these changes? Is it as simple as
> turning postgres off on both servers, changing the IP settings (master -
> postgres.conf and hba.conf and slave - recovery.conf files to the local
> network IPs) and starting the service up again? Can anyone point me to an
> example?
>
> Any tips, suggestions, help you could provide would be greatly appreciated.
>
> Thanks in advance for your time!
>
>
> if these two servers are both local, there's absolutely no reason to use
> public IP space for this, they should be using their local addresses,
> faster, lower latency, otherwise each round trip packet is going through 4
> layers of NAT (out, in, then out, in again to return).
>
> make sure the master allows the slave replication account to connect via
> its local IP (this would be in pg_hba.conf, and a 'reload'), then change
> the address the slave is using to connect to the master, and restart the
> slave, and it all should be good.
>
>
>
> --
> john r pierce 37N 122W
> somewhere on the middle of the left coast
>
> --

*Dara J. Olson Unglaube*
Aquatic Invasive Species Coordinator
Great Lakes Indian Fish & Wildlife Commission
P.O. Box 9, 72682 Maple Street
Odanah, WI 54861
(715) 682-6619 ext.2129
dara(at)glifwc(dot)org <dolson(at)glifwc(dot)org>
maps.glifwc.org

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert DiFalco 2014-12-09 18:15:40 Help Optimizing a Summary Query
Previous Message FarjadFarid(ChkNet) 2014-12-09 15:54:58 List of shorthand casts