Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 1.49 KB

README.md

File metadata and controls

68 lines (49 loc) · 1.49 KB

mongosync pod

Build Docker

Image is build with each merge to main branch. For specific version, set a tag. That will trigger new build.

Create mongosync-user user

Login to destintation and source database. Start mongosh and execute following commands:

db.adminCommand( {
   createRole: "reverseSync",
   privileges: [ {
       resource: { db: "", collection: "" },
       actions: [ "setUserWriteBlockMode", "bypassWriteBlockingMode" ]
   } ],
   roles: []
} )
use admin
db.createUser(
   {
     user: "mongosync-user",
     pwd: "<strong-password>",
     roles: [ "readWrite", "dbAdmin", "reverseSync"]
   }
)

If you have doubts regarding roles required by mongosync, please refer to official documentation.

Deploy on mongosync service on Kubernetes cluster

Create new namespace

kubectl create namespace infra-mongosync

Update cluster0 and cluster1 fields in ./manifests/mongosync-cm.yml file and apply it.

kubectl apply -f ./manifests/mongosync-cm.yml

Next, deploy mongosync pod.

kubectl apply -f ./manifests/mongosync-deployment.yml

Expose port to mongosync

kubectl -n infra-mongosync port-forwards svc/mongosync 27182:27182

Verify connection to mongosync pod.

curl http://localhost:27182/api/v1/progress

Start migration

curl localhost:27182/api/v1/start -XPOST --data @payload.json