Comments on How to Install and Configure Master-Slave Replication with PostgreSQL 9.6 on CentOS 7
PostgreSQL or Postgres is an open source object-relational database management system (ORDBMS) with more than 15 years of active development. It's a powerful database server that can handle high workloads. PostgreSQL can be used on Linux, Unix, BSD, and Windows servers.
15 Comment(s)
Comments
Excellent article!
how about performing a failover (make slave writable) and failback (reverse replication)?
Such a nice article, was able to follow along and successfully set up replication.
But, how can I provide an unique ip for my clients, so if a server goes down it would be transparent for my users?
Regards
I have followed all the steps ,I am using Postgresql 10
But I am not getting state value is 'streaming', and the sync_state is 'sync' and also application_name.
Hi Akarsh,
I have configured on postgres10 on Linux with the help of this doc. It is working fine for me. Just Double check these parameters on master and slave.
On Master, in postgresql.conf,
synchronous_standby_names = 'pgslave01' And in Slave, in recovery.confstandby_mode = 'on'primary_conninfo = 'host=10.0.15.10 port=5432 user=replica password=aqwe123@ application_name=pgslave01'Application_name=synchronous_standby_names, should be same in master and slave.
Thanks.
Hello
@Gaurav thank you very much for your information, right now I am needing to add the steps that you configured to do the failover and failback, there is a possibility that you help with this information because I do not know how to do it, since the replica is already working, now I need that failover when the master has errors.
Thanks for your help
was the page translated accidentally?
Hi There,
Excellent Artical. Short and crisp.
Please add more steps for below test:
(1) Create cascade standby from slave.
Master --> Slave1 (Hot Standby) --> Slave2 (cascade warm standby)
(2) Failover and Failback statergy
(1) Failover:
Master Fails. Slave1 will be master and slave2 will be warm standby
Failback:
When Master comes back, slave1 will become hot standby again and slave2 will be warm standby.
(2) Failover:
Master and Slave1 - both fails. Slave2 will be master.
Failback:
When Master and Slave1 comes back, The role back should happen as before.
========
Is there any way to use pg_rewind feature in this approach?
============
I am testing all above. If I find something, I will post here.
Once again, Thanks for the tutorial.
Regards,
Gaurav
Hello
Gaurav I am new to this Postgresql medium, and I would like if you could share with me the procedure you used to apply
(1) Create standby cascade from slave.
Master -> Slave1 (Hot Standby) -> Slave2 (standby cascade)
(2) Failover and Failback statergy
(1) Failover:
The teacher fails. Slave1 will be master and slave2 will be on active standby
Failback:
When the Master returns, slave1 will go back to hot standby and slave2 will be back to hot standby.
(2) Failover:
Master and Slave1: both fail. Slave2 will be the master.
Failback:
When Master and Slave1 returns, the return role must happen as before.
I appreciate what you can help me
The archive_command as written here copies the WALs directly into the pg_xlog of the secondary server. This works but is a bad practice — you shall never mess with a server WALs!.
A better target would be a repository somewhere else. Then the recovery.conf should contain a restore_command like 'cp /mnt/server/archivedir/%f %p', and a archive_cleanup_command to clean the used WALs.
Excellent article !!
Each and every step mentioned here.
create a file named "recovery.conf". and where to create? path?
What OSI can tell path
I have followed all the steps , I have done it.
me too