Docs Menu
Docs Home
/
MongoDB Cluster-to-Cluster Sync
/ /

Verify with Migration Verifier

On this page

  • About This Task
  • Steps
  • Learn More

Migration Verifier connects to the source and destination clusters and performs a series of verification checks, comparing documents, views, and indexes to confirm the sync was successful.

Unlike other verification methods, Migration Verifier can run concurrently with mongosync, checking documents on the destination cluster as they sync. This can reduce the amount of time needed to verify the success of the sync before transferring your application load from the source to the destination cluster.

Note

Migration Verifier does not support DDL operations. Do not run any DDL operations on the source cluster while verifying data with Migration Verifier.

Migration Verifier is an experimental and unsupported tool.

For installation instructions and usage limitations, see GitHub.

1

Sync the source and destination clusters using mongosync. For more information, see Cluster-to-Cluster Sync Quickstart.

2

Before you can start verification checks with Migration Verifier, you must wait until mongosync reaches the Change Event Application (CEA) phase.

To check that mongosync has reached the CEA phase, send the /progress command and check that the progress.info field returns change event application.

curl localhost:27182/api/v1/progress -XGET
{
"progress":
{
"state":"RUNNING",
"canCommit":true,
"canWrite":false,
"info":"change event application",
"lagTimeSeconds":0,
"collectionCopy":
{
"estimatedTotalBytes":694,
"estimatedCopiedBytes":694
},
"directionMapping":
{
"Source":"cluster0: localhost:27017",
"Destination":"cluster1: localhost:27018"
}
}
}
3

Start the migration-verifier process:

migration-verifier --verifyAll \
--srcURI example.net:27020 \
--destURI example.net:27021 \
--metaURI example.net:27017
4

To start the verification checks, use cURL to send the check command to Migration Verifier:

curl -H "Content-Type: application/json" \
-X POST -d '{}' http://127.0.0.1:27020/api/v1/check
5

When the sync is complete and mongosync has reached the COMMITTED state, use cURL to send the writesOff command to Migration Verifier:

curl -H "Content-Type: application/json" \
-X POST -d '{}' http://127.0.0.1:27020/api/v1/writesOff
6

To view the results, use cURL to send the progress command to Migration Verifier.

curl -H "Content-Type: application/json" \
-X GET http://127.0.0.1:27020/api/v1/progress
{
"progress": {
"phase": "idle",
"error": null,
"verificationStatus": {
"totalTasks": 1,
"addedTasks": 0,
"processingTasks": 0,
"failedTasks": 0,
"completedTasks": 0,
"metadataMismatchTasks": 0,
"recheckTasks": 0
}
}
}

When the phase field is idle, the verification checks are complete. If the failedTasks field returns 0, the sync was successful.

Back

Use Hash Comparison