Postgres Stream Replication Failover Questions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Postgres Stream Replication Failover Questions

Mahmoud Moharam
Dear All ,
as I try to configure Postgres Stream Replication Failover strategy some questions pop-up so can you please help on answering these concerns
1. What happens to the master server when I kill the slave server?
2. Is replication going to affect insert speed on the master server?
3. What happens when I kill master and slave is running? is there an automatic way to check and auto promote ?
4. If I started inserting into slave (which will become master) server until old master is back, do I have to reverse the configuration? 

thanks all
Reply | Threaded
Open this post in threaded view
|

Re: Postgres Stream Replication Failover Questions

Shreeyansh dba
Hi Mahmoud,
Please find answers in line...

On Wed, Mar 27, 2019, at 12:07 PM Mahmoud Moharam <[hidden email]> wrote:
Dear All ,
as I try to configure Postgres Stream Replication Failover strategy some questions pop-up so can you please help on answering these concerns
1. What happens to the master server when I kill the slave server?
It depends on what type replication mode, you use.
     i. In case synchronous replication master-slave always running if slave not available then master goes to waiting state.
    ii. In case asynchronous replication if slave not available, then master server work.
2. Is replication going to affect insert speed on the master server?
All write operation performed on master server only. To improve performance you can use slave for select operations.
3. What happens when I kill master and slave is running? is there an automatic way to check and auto promote ?
If Master kills, then Slave is continue running in recovery mode. You can manually promote the Slave as Master. There are so many tools available to perform the auto failover. 
4. If I started inserting into slave (which will become master) server until old master is back, do I have to reverse the configuration? 
Yes, you can rebulid manually. There are so many tools available to perform the auto switchover.

Thanks & Regards,
Shreeyansh DBA Team
www.shreeyansh.com
Reply | Threaded
Open this post in threaded view
|

Re: Postgres Stream Replication Failover Questions

Mahmoud Moharam
thanks for your kind reply

4. If I started inserting into slave (which will become master) server until old master is back, do I have to reverse the configuration? 

Yes, you can rebulid manually. There are so many tools available to perform the auto switchover.
what will happen to data which insert into slave (promoted master ) when I original master become healthy
is there is a doc which show failover in detailed steps ?

On Wed, Mar 27, 2019 at 10:10 AM Shreeyansh Dba <[hidden email]> wrote:
Hi Mahmoud,
Please find answers in line...

On Wed, Mar 27, 2019, at 12:07 PM Mahmoud Moharam <[hidden email]> wrote:
Dear All ,
as I try to configure Postgres Stream Replication Failover strategy some questions pop-up so can you please help on answering these concerns
1. What happens to the master server when I kill the slave server?
It depends on what type replication mode, you use.
     i. In case synchronous replication master-slave always running if slave not available then master goes to waiting state.
    ii. In case asynchronous replication if slave not available, then master server work.
2. Is replication going to affect insert speed on the master server?
All write operation performed on master server only. To improve performance you can use slave for select operations.
3. What happens when I kill master and slave is running? is there an automatic way to check and auto promote ?
If Master kills, then Slave is continue running in recovery mode. You can manually promote the Slave as Master. There are so many tools available to perform the auto failover. 
4. If I started inserting into slave (which will become master) server until old master is back, do I have to reverse the configuration? 
Yes, you can rebulid manually. There are so many tools available to perform the auto switchover.

Thanks & Regards,
Shreeyansh DBA Team
www.shreeyansh.com
Reply | Threaded
Open this post in threaded view
|

Re: Postgres Stream Replication Failover Questions

Shreeyansh dba

On Wed, Mar 27, 2019 at 1:49 PM Mahmoud Moharam <[hidden email]> wrote:
thanks for your kind reply

4. If I started inserting into slave (which will become master) server until old master is back, do I have to reverse the configuration? 

Yes, you can rebulid manually. There are so many tools available to perform the auto switchover.
what will happen to data which insert into slave (promoted master ) when I original master become healthy
is there is a doc which show failover in detailed steps ?


If the primary server fails and the standby server becomes the new primary, and then the old primary restarts, you must have a mechanism for informing the old primary that it is no longer the primary. It is necessary to avoid situations where both systems think they are the primary, which will lead to confusion and ultimately data loss.

For more information go through below link :
https://www.postgresql.org/docs/9.6/warm-standby-failover.html

Thanks & Regards,
Shreeyansh DBA Team
www.shreeyansh.com

On Wed, Mar 27, 2019 at 10:10 AM Shreeyansh Dba <[hidden email]> wrote:
Hi Mahmoud,
Please find answers in line...

On Wed, Mar 27, 2019, at 12:07 PM Mahmoud Moharam <[hidden email]> wrote:
Dear All ,
as I try to configure Postgres Stream Replication Failover strategy some questions pop-up so can you please help on answering these concerns
1. What happens to the master server when I kill the slave server?
It depends on what type replication mode, you use.
     i. In case synchronous replication master-slave always running if slave not available then master goes to waiting state.
    ii. In case asynchronous replication if slave not available, then master server work.
2. Is replication going to affect insert speed on the master server?
All write operation performed on master server only. To improve performance you can use slave for select operations.
3. What happens when I kill master and slave is running? is there an automatic way to check and auto promote ?
If Master kills, then Slave is continue running in recovery mode. You can manually promote the Slave as Master. There are so many tools available to perform the auto failover. 
4. If I started inserting into slave (which will become master) server until old master is back, do I have to reverse the configuration? 
Yes, you can rebulid manually. There are so many tools available to perform the auto switchover.

Thanks & Regards,
Shreeyansh DBA Team
www.shreeyansh.com