How Do I Set Up Data Center in Warm Standby Mode?
This use case explains how to set up the data centers in warm standby mode to achieve disaster recovery.
For example, assume that you have two data centers DC 1 and DC 2 in the following landscape:
Data Center Name | Host Name | Region |
DC 1 | uk.myhost.com | United Kingdom |
DC 2 | us.myhost.com | United States |
Here, DC 1 serves the traffic, and in DC2, only external Elasticsearch is up and running, whereas API Gateway is in a shutdown state.
Pre-requisites
Install
API Gateway in DC2 and ensure that the fix upgrades of DC1 is applied to DC2 too.
Run the following backup REST API periodically to take a snapshot of data from DC1 and store the snapshots in a suitable externalized storage system based on the RPO:
curl -si -X POST -H "content-type:application/json" -d '{"indices": "gateway_tenant_*"}' http://es-host:es-port/_snapshot/repo-name/backup_file_name
Run the following restore REST API periodically to restore the backup snapshots from the externalized storage in DC2.
curl -si -X POST -H "content-type:application/json" -d '{"indices": "gateway_tenant_*"}' http://es-host:es-port/_snapshot/repo-name/backup_file_name/_restore
For more information about backup and restore, see
Data BackupFailover and Failback process
1. During the failover process:
Restart
API Gateway in DC2.
As external Elasticsearch is up and running and the data is already restored from the snapshots in external Elasticsearch, you just have to restart API Gateway in DC 2. The downtime for this mode would be only the time until API Gateway is up.
Reconfigure the load balancer by exposing DC 2 to the client.
2. During the failback process:
Run the following command in DC 2 to back up the data:
curl -si -X POST -H "content-type:application/json" -d '{"indices": "gateway_tenant_*"}' http://es-host:es-port/_snapshot/repo-name/backup_file_name
Run the following command in DC 1 to restore the backed up data:
curl -si -X POST -H "content-type:application/json" -d '{"indices": "gateway_tenant_*"}' http://es-host:es-port/_snapshot/repo-name/backup_file_name/_restore
Restart
API Gateway in DC 1.
Reconfigure the load balancer by exposing DC 1 to the client.