From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Postgres Replication on a different network interface
Date: Tue, 1 Sep 2020 14:13:07 +0300
Message-ID: <9b5b88a0-83b5-711f-d70c-11f4b25ed5ea@matrix.gatewaynet.com> (raw)
In-Reply-To: <CAAUegEKQL5FdxR_St-B2J7A-D7fpvJRRSVVKf9iHxhmmTxhyaw@mail.gmail.com>
References: <CAAUegEKQL5FdxR_St-B2J7A-D7fpvJRRSVVKf9iHxhmmTxhyaw@mail.gmail.com>
On 1/9/20 1:43 μ.μ., Sanjib Mohanty wrote:
> Hi Experts,
>
> I had done replication earlier in EDB 9.6 version using simple WAl
> replication.
>
> My master server is listening on localhost.
>
> Example:
> listen_addresses = 'localhost,158.245.240.209'
>
> I have another additional IP configured on my both master and slave
> servers which is a dedicated network for my replication traffic example,
>
> Primary : 172.176.43.112 , Salve: 172.198.47.101 ,
>
> Question:
>
> Can I configure this Ip only for replication ?
>
Yes via pg_hba.conf
> My understanding:
>
> postgresql.conf:
>
> listen_addresses = 'localhost, < what all ips we should configure
> here>' /// Do I need to add these replication traffic ip address
> here?? Please help
>
>
> On Master
> wal_level = logical or Hot_Standby
>
> max_wal_senders = 4
>
> max_replication_slots = 4
>
>
>
>
> On Replica
> In addition to the above, the following need to be configured on the
> replica:
>
> hot_standby = on
>
> hot_standby_feedback = on
>
> pg_hba.conf:
> host replication repuser 172.198.47.101 /32 md5
>
>
> Salve:
>
> standby_mode = 'on'
>
> primary_conninfo = 'host=172.198.47.101 port=5432 user=foo
> password=foopass'
>
> restore_command = 'cp /path/to/archive/%f %p'
>
> archive_cleanup_command = 'pg_archivecleanup /path/to/archive %r'
>
>
> One more question?
>
> If I have to replicate the replication traffic from master to 2
> different sites.
>
> Site1 ( Production) Active: One Primary (read write) M1 , 2nd one is
> Slave (read only) S1
>
> Site2(Disaster) Passive : One Primary (read write) M2 2nd one is
> Slave (read only) S2
>
> Note: I have already configured replication within the site1 , where
> slave get the wal file using wal replication.
> Question?
> Do I need to add another server as slave the Site 2 and replicate from
> the Production Primary ? what is the best practise. ?
>
>
> The sync I have plan is : M1->S1 & M2 , and then M2->S2 // please
> advise.
The are a lot of things to consider and lots of choices as well.
Availability/reliability of the master is one thing VS things that can
go wrong in the remote network.
What you have in mind (site2 : One Primary (read write)) is doable with
logical replication which takes a different approach to physical. More
flexible for sure but also needs more work and planing to be done.
Why do you want M2 to be read/write?
>
>
>
>
>
> Regards,
> Sanjib
>
>
>
>
>
>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: achill@matrix.gatewaynet.com, pgsql-admin@lists.postgresql.org
Subject: Re: Postgres Replication on a different network interface
In-Reply-To: <9b5b88a0-83b5-711f-d70c-11f4b25ed5ea@matrix.gatewaynet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox