Percona ClusterSync for MongoDB (PCSM) is an open-source binary process that replicates data between MongoDB deployments in real time until you manually finalize it. You can also make a one-time data migration from the source to the target with zero downtime.
Key features include:
For more information and related downloads for Percona ClusterSync for MongoDB® and other Percona products, please visit http://www.percona.com.
Percona ClusterSync for MongoDB Docker images are created and maintained by the Percona team.
Images are updated when new releases are published.
You need to either deploy MongoDB or Percona Server for MongoDB as your source and target clusters, or use existing deployments. Both clusters can run in Docker containers, on virtual machines, or in cloud environments.
The PCSM container must be able to reach all nodes in both source and target MongoDB clusters over the network. This includes:
mongos nodes in source and target clustersCreate users in both source and target clusters with appropriate permissions for authentication.
This is the example command:
db.getSiblingDB("admin").createUser({
user: "source",
pwd: "mys3cretpAss",
roles: ["backup", "clusterMonitor", "readAnyDatabase"]
});'
Your source cluster has some data to verify the replication.
Start Percona ClusterSync for MongoDB container. You can specify connection strings using environment variables or command-line flags:
Using environment variables:
Use the PCSM_SOURCE_URI and PCSM_TARGET_URI environment variables:
docker run --name <container-name> --network <mymongo> -d \
-e PCSM_SOURCE_URI="mongodb://<source-user>:<source-password>@psmdb-source:27017" \
-e PCSM_TARGET_URI="mongodb://<target-user>:<target-password>@psmdb-target:27017" \
percona/percona-clustersync-mongodb:<tag>
Using the command line flags:
Pass the --source and --target flags directly:
docker run --name <container-name> --network <mymongo> \
-d percona/percona-clustersync-mongodb:<tag> \
--source "mongodb://<source-user>:<source-password>@psmdb-source:27017" \
--target "mongodb://<target-user>:<target-password>@psmdb-target:27017"
Replace <source-user>:<source-password> and <target-user>:<target-password> with the credentials of the users you created for pcsm process in the source and target clusters.
Where:
container-name is the name you want to assign to your container,PCSM_SOURCE_URI and PCSM_TARGET_URI are environment variables and --source and --target are command line flags for MongoDB Connection URI strings used to connect to source and target MongoDB clusters.mymongo is the network where the source and target clusters are running if deployed in Docker, andtag is the tag specifying the version and architecture you need. See the list above for relevant tags, or look at the full list of tags.Check the initial status of PCSM. Replace with the name of your container:
docker exec -it <container-name> pcsm status
The status should be idle, indicating PCSM is ready to accept requests.
Replace pcsm1 with the name of your container in the following commands:
Start the replication process:
docker exec -it pcsm1 pcsm start
Monitor replication by checking the status:
docker exec -it pcsm1 pcsm status
View logs to monitor activity:
docker logs -f pcsm1
We welcome your feedback!
Content type
Image
Digest
sha256:e9b2f0673…
Size
98 MB
Last updated
4 months ago
docker pull percona/percona-clustersync-mongodbPulls:
78
Last week