Warm Disaster recovery on Google Cloud for applications running on-premises
Get Cooking in Cloud
“Get Cooking in Cloud” is a blog and video series to help enterprises and developers build business solutions on Google Cloud. In this second miniseries I am covering Disaster Recovery on Google Cloud. Disasters can be pretty hard to deal with when you have an online presence. In this series of blogs, we will elaborate on how to deal with disasters like earthquakes, power outages, floods, fires etc. If you are interested in the prior mini series covered, checkout this.
Here is the plan for the series.
- Disaster Recovery Overview
- Cold Disaster recovery on Google Cloud for on-premise applications
- Warm Disaster recovery on Google Cloud for on-premise applications (This article)
- Hot Disaster recovery on Google Cloud for on-premise applications
- Cold Disaster recovery for applications in Google Cloud
- Cold Disaster recovery for applications in Google Cloud
- Warm Disaster recovery for applications in Google Cloud
- Hot Disaster recovery for applications in Google Cloud
- Disaster recovery on Google Cloud for Data: Part 1
- Disaster recovery on Google Cloud for Data: Part 2
In this article, you will learn to set up a Warm DR pattern for your applications that are deployed on-premises. So, read on!
What you’ll learn
- Warm DR pattern with an example
- Steps to be taken before a disaster hits
- Steps to be taken during a disaster
- Steps to be taken after a disaster
- Basic concepts and constructs of Google Cloud so you can recognize the names of the products.
- Read the overview article before continuing on.
Check out the video
Let’s learn Warm DR pattern with an example
In the last article we talked about Mane-street Art that runs their applications on-premises and are building a DR infrastructure on Google Cloud. And we saw how they would set up a Cold DR plan.
Mane-street Art’s situation has evolved since then, they now need to set up warm standby DR pattern to keep RTO and RPO values as small as possible without the effort and expense of a fully HA configuration. Which means, to support a disaster, they need some replication and redundancy built-in.
Note: If you are unfamiliar with the terms used here (RTO, RPO, DR Patterns) checkout the previous blog to get an overview.
In any DR pattern you need to understand what steps need to be taken before a disaster hits, what happens when a disaster hits and what needs to happen after the disaster has passed.
Warm DR Pattern — How does it work?
Steps to be taken before disaster hits
- Create a VPC network
- Configure the connectivity between the on-premises network and the Google Cloud network
- Replicate the on-premise servers to the Compute Engine instances.
- Create snapshots of the web and application server instances
- Then Create a custom image of the database server on Google cloud, with same configuration as on-premise.
- Then start a database instance in google cloud using that custom image and attach Persistent Disk to this instance for Database and transaction logs.
- Configure replication of the Database server.
- Set auto delete flag on the persistent disk to no-auto-delete. We do this so that our Persistent disk will not be inadvertently deleted, since that would be a disaster
- Configure a scheduled task to create regular snapshots of the Persistent disk of the DB instance on Google cloud
- Then, test the process of creating instances from snapshots by creating the web and application server
- Also, Create a script that copies updates to the web application and the application server whenever the corresponding on-premise servers are updated. Write the scripts to create a snapshot of the updated servers.
- Then configure cloud DNS to point to the internet facing web service on-premise.
Steps to be taken when disaster hits
- When a disaster hits, all Mane-street art needs to do, is to resize the Database server instance to handle the production load.
- Use the web and application server snapshots to create new web and app server instances
- Test that it all works
- Then, finally, point cloud DNS to their web service on Google Cloud
Steps to be taken after the disaster has passed
When the production environment is running on-premises again and can support production workloads, Mane-street art has to reverse the steps that they followed during failover. Typically it goes something like this:
- Take a backup of the database running on Google cloud.
- Copy and apply the backup file to the database in the production environment.
- Prevent connections to the application in Google Cloud.
- One way to do this is to prevent connections to the web server by modifying the firewall rules.
- From this point the application will be unavailable until we finish restoring the production environment.
- Don’t forget to Copy any transaction log files over to the production environment and apply to the database in the production environment.
- Test that the application works as expected by simulating user scenarios on the production environment.
- Configure Cloud DNS to point to the on-premises web service.
- Delete the web server and application server instances that are running in Google Cloud. Leave the reference servers running.
- Resize the database server on Google cloud back to the minimum instance size that can accept replicated data from the on-premises production database.
- Configure replication between the on-premises database server and the database server in Google Cloud by following the instructions for your specific database software.
If you are running your application on premise, and need to keep the RTO and RPO values as small as possible without the expense of a fully HA configuration, then a Warm DR pattern is the way to go. We learned how to approach recovering the environment from failure in a Warm DR scenario. Stay tuned for upcoming articles, where you will learn to set up more DR patterns that make sense for your business.
- Follow this blog series on Google Cloud Platform Medium.
- Reference the DR solutions.
- Follow Get Cooking in Cloud video series and subscribe to Google cloud platform YouTube channel
- Want more stories? Check my Medium, follow me on twitter.
- Enjoy the ride with us through this miniseries and learn more about more such Google Cloud solutions :)