Skip to content

The repository is example for setup MongoDB with Replica Set use Docker Container

Notifications You must be signed in to change notification settings

thanhxuanhd/MongoDbReplicaSet

Repository files navigation

How to setup MongoDb Replica Set with replica key

The repository is example for how to setup replica set in local machine with docker containers.

How to run

  1. Github Codespace
  • Start database
sh run.sh 
  • Shutdown database
sh shutdown.sh
  • Connect to mongoDB primary instantce
docker exec -it mongodb1 mongosh
  1. In local machine
  • Start database
./run.sh 
  • Shutdown database
./shutdown.sh
  • Connect to mongoDB primary instantce
docker exec -it mongodb1 mongosh

How to create replica key

openssl rand -base64 756 > ./mongo/replica.key
chmod 400 ./mongo/replica.key

Reference document

About

The repository is example for setup MongoDB with Replica Set use Docker Container

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages