The repository is example for how to setup replica set in local machine with docker containers.
- Github Codespace
- Start database
sh run.sh
- Shutdown database
sh shutdown.sh
- Connect to mongoDB primary instantce
docker exec -it mongodb1 mongosh
- In local machine
- Start database
./run.sh
- Shutdown database
./shutdown.sh
- Connect to mongoDB primary instantce
docker exec -it mongodb1 mongosh
openssl rand -base64 756 > ./mongo/replica.key
chmod 400 ./mongo/replica.key
Reference document