This cluster has no access control mechanism till now. Don't forget to enable it before deploying to production.
This project will help you to setup a replica set of mongo db.
Original Repo : https://github.com/minhhungit/mongodb-cluster-docker-compose Original Readme : Readme
Docker
, Git
and Docker Compose
should be installed on your system.
-
Clone the project.
git clone https://github.com/Velorona-LLC/mongodb-replica-set.git
-
Execute the
install.sh
file. It will:- Step 1: Start all of the containers
- Step 2: Initialize the replica sets (config servers and shards)
- Step 3: Initializing the router
- Step 4: Verify status of replica set for each shard
You should see 1 PRIMARY
, 2 SECONDARY
You can connect to the replica set, by connecting to the router 1
and router 2
at port 27117
and/or 27118
.
mongodb://<username>:<password>@<router1:port1>,<router2:port2>/<database>?authSource=admin
Author Name : Shree Krishna Lamichhane
Author URI : shreekrishnalamichhane.com.np
GitHub URI : shreekrishnalamichhane
List of all Contributors:
Thank you for using this documentation. If you love this project give it a star.