Skip to content

Data Center (DC) and Disaster Recovery (DR) Drill Steps

DC/DR drill procedure: replication from DC to DR and from DR to DC.

3 min read Updated SS

The DC and DR drill steps are techniques for testing and certifying disaster recovery strategies for a major outage. The drills are conducted on time (after the installation, updates, and if any issues are found) to avoid major outages and cause data loss.

Follow the steps below to perform the drill:

Replication from DC to DR#

Suspend DC data collection and wait for 5–10 minutes to index and sync pipeline data to the DR side.

1. On DR Node

Follow the steps below on the DR node to configure the replication from the DR site to the DC site.

1. To enable writing, suspend Replication on all indexes for the current week so that they can be updated manually.

Note: Indexes are read-only during replication. Stopping replication lets you write to the index.

curl -XPOST -k -H "Content-Type: application/json" -u 'admin:admin'
'https://slave:9200/_plugins/_replication/<index name for current week>/_stop?pretty' -d '{}'

2. Stop index auto-follow.

curl -XDELETE -k -H "Content-Type: application/json" -u 'admin:admin'
'https://192.0.2.87:9200/_plugins/_replication/autofollow?pretty' -d '
{
  "leader_alias": "my-connection-alias2",
  "name": "heal_collated_txn"
}'

3. Validate the replication status by using the _status API.

curl -XGET -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/follower-01/_status?pretty'

2. On DC Node

Follow the steps below on the DC node to establish replication from the DC site to the DR site.

1. Validate the current week’s index size and document count between master and slave to ensure they match.

In master:

curl -ku 'admin:admin' -XGET "https://<master>:9200/_cat/indices/<index name for current week>?v"

In a slave:

curl -ku 'admin:admin' -XGET "https://<slave>:9200/_cat/indices/<index name for current week>?v"

2. If the document count matches, delete the index from the master:

curl -ku 'admin:admin' -XDELETE "https://master:9200/<Index Name>"

3. If the document count does not match, then follow the steps below:

  • Reindex the current week index in the DC to _reindexed:
curl -ku 'admin:admin' -XPOST "https://<master>:9200/_reindex" -H "Content-Type:
application/json" -d '{
 "source": { "index": "<SourceIndex>" }, "dest": { "index": "<DestinationIndex>" }}'
  • Delete the current week’s index:
curl -ku 'admin:admin' -XDELETE "https://master:9200/<Index Name>"

4. Set up a Connection Alias on the master with endpoint details to connect to the slave:

curl -XPUT -k -H "Content-Type: application/json" -u 'admin:admin'
'https://master:9200/_cluster/settings?pretty'
-d '
{
 "persistent": {
 "cluster": {
 "remote": {
 "my-connection-alias2": {
 "seeds": ["slave:9300"]
 }
}
}
}
}'

5. Start replication for the current week index in the master:

curl -XPUT -k -H "Content-Type: application/json" -u 'admin:admin'
'https://master:9200/_plugins/_replication/<index name for current week>/_start?pretty' -d '
{
  "leader_alias": "my-connection-alias2",
  "leader_index": "<current week Index>",
  "use_roles":{
  "leader_cluster_role": "all_access",
  "follower_cluster_role": "all_access"
}
}'

6. Validate the replication status using the _status API for the current week index:

curl -XGET -k -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/follower-01/_status?pretty'

7. Start data collection in DR.

8. Validate data collection in DR.

9. Validate the replication status on the DC side.

Replication from DR to DC#

Suspend DR data collection and wait for 5–10 minutes to index and sync pipeline data to the DC side.

Follow the steps below for the replication from DR to DC:

1. To enable writing, suspend Replication on all indexes for the current week so that they can be updated manually.

curl -XPOST -k -H "Content-Type: application/json" -u 'admin:admin'
'https://master:9200/_plugins/_replication/follower-01/_stop?pretty' -d '{}'

2. Validate the replication status using the _status API:

curl -XGET -k -u 'admin:admin' 'https://master:9200/_plugins/_replication/follower-01/_status?pretty'

3. Validate the current week’s index size and document count between master and slave to ensure they match:

In master:

curl -ku 'admin:admin' -XGET "https://master:9200/_cat/indices/<index name for current week>?v"

In a slave:

curl -ku 'admin:admin' -XGET "https://slave:9200/_cat/indices/<index name for current week>?v"

4. If the document count matches, delete the index from the slave:

curl -ku 'admin:admin' -XDELETE "https://slave:9200/<index name for current week>"

5. Start replication for the current week's indexes:

curl -XPUT -k -H "Content-Type: application/json" -u 'admin:admin'
'https://slave:9200/_plugins/_replication/<index name for current week>/_start?pretty' -d '
{
  "leader_alias": "my-connection-alias",
  "leader_index": "leader-01",
  "use_roles":{
  "leader_cluster_roles": "all_access",
  "follower_cluster_role": "all_access"
}
}'