BART and failover

Highlighted
Level 3 Adventurer

BART and failover

Before I start digging into some scripting, I'm curious if anyone has designed anything to automatically switch which server BART is backing up if the master goes down and the standby becomes the master?

 

Best,
Larry

Archived Discussions


Effective March 31st, we will no longer engage on PostgresRocks.


How to engage with us further?


  • Thought Leadership: EDB Blogs

  • Tips and Tricks: Postgres Tutorials

  • Customer Support: Create a Case Please note: Only customers with an active EDB support subscription and support portal authorization can create support ticket

  • Engage on Stackoverflow While engaging on Stackoverflow tag the question with EDB or EnterpriseDB.

2 REPLIES 2
Highlighted
EDB Team Member

Re: BART and failover

Hi lgwapnitsky,

 

Using VIP In this case will be wise decision.

The VIP remains active on Master and moves on to the Slave in case of failover.

 

Hope this helps.

Highlighted
Level 2 Adventurer

Re: BART and failover

Maybe you can include a check on 'Database cluster state' of pg_controldata command in your backup script. 

bash-4.4$ pg_controldata -D /var/lib/postgresql/data/ | grep 'Database cluster state'
Database cluster state: in production
bash-4.4$

If it is under recovery then do nothing, otherwise performs the BART backup.

 

Then setup the backup script to all DB servers, primary and standby(s) with cronjob.

 

Currently we setup BART on both primary/standby DBs, decide which database is the master and perform backup job with cronjob. And we mount a NFS directory on both of them for WAL archiving/restoring.

© 2019 EnterpriseDB Corporation. All rights reserved.   |   Privacy Policy   |  Terms of Use   |   Trademarks