OPDK - Postgres Master Recovery from VM Image

Not applicable

Hello,

OPDK -15.04

We have two postgres servers - A[Master] and B[Slave].

If in case master[A] goes down due to server crash and if we have to restore the server from VM backup image, following are the steps that we have identified.

1. Make the curent Slave[B] as Master so that live analytics data is not lost.

2. Just before recovering the server in which old master[A] resides, stop all qpid servers so that there will not be any inflow data.

3. Make the current master[B] as slave again

4. Restore the old master[A] from VM image.

5. Start the Qpid servers

Question:

What is the command that we have to run in step 3 to make a master as slave?

Are there any other missing steps that we have to perform to achieve complete recovery?

Note- We are specifically looking for recovery from VM image and not from postgres backup[Apigee recommended]

Thanks,

Adarsh

0 6 268
6 REPLIES 6

For Step 3, did you try:

/<inst-root>/apigee4/bin/postgres-copy-masters

Check out the Operations guide - there is a sectionin it called "Handling a PostgresSQL Database Failover".

Stephen

Hi,

When i tried this for 15.07 i was able to make slave into master and back to slave. But i was not able to make postgres master to slave and yes i followed the steps mentioned in operations guide.

also I wonder what we have to do if postgres master is terminated and you've to add a new postgres slave into the cluster.

so im going to be honest with you: i have someone on staff that I made figure all of this out and get really good at it 🙂

looking at your steps above I suspect that this IS NOT the recommended method for recovery. I would have to think about it - but i would expect that you would recover the A server into a slave configuration so you dont lose the data you captured during the outage.

I followed the steps mentioned in operations guide to failover a slave into master... but as my master is completely down there is no way i can make it master again. Now I have only one postgres server in my cluster which is functiong as master and I still require to add a new slave to make sure high availability is maintained.

if your master is down you already have only one server. It would seem logical that you need to somehow restore the old master [a] as a slave, replicate the data from the current master [b] back to it, and then you can go about business as usual or fail back.

unfortunately i dont have anything I can do to help with this. I see a couple of options. Help at this point in your scenario is probably best done in real time rather than in the community forums.

Not applicable

Hi Adarsh,

I am Kaushal and quite interested in your question. Please share me your contact details and i will try to reach you and share you the steps.

Regards,

Kaushal