Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vhidvz/mongo-rs
Mongodb replica set with docker compose and three nodes
https://github.com/vhidvz/mongo-rs
docker-compose mongodb replica-set
Last synced: about 2 months ago
JSON representation
Mongodb replica set with docker compose and three nodes
- Host: GitHub
- URL: https://github.com/vhidvz/mongo-rs
- Owner: vhidvz
- License: mit
- Created: 2022-08-22T15:11:38.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-09-26T18:05:18.000Z (over 1 year ago)
- Last Synced: 2023-09-27T00:23:09.988Z (over 1 year ago)
- Topics: docker-compose, mongodb, replica-set
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 9
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mongo-RS
Mongo replication set with four nodes, run and start with docker compose:
```sh
sudo mkdir -p -m 777 mongo/primary
sudo chown -R 1001 mongo
```> NOTE: As this is a non-root container, the mounted files and directories must have the proper permissions for the UID 1001.
```sh
docker-compose up -d
```> NOTE: It will take time to initiate for first time
Add this lines to `/etc/hosts`:
```sh
127.0.0.1 mongodb-primary
127.0.0.1 mongodb-secondary-1
127.0.0.1 mongodb-secondary-2
127.0.0.1 mongodb-arbiter
```## Connection URI
`mongodb://root:password123@mongodb-primary:27017,mongodb-secondary-1:27018,mongodb-secondary-2:27019,mongodb-arbiter:27020/?replicaSet=rs0&authSource=admin`
### Reference
- https://github.com/bitnami/containers/tree/main/bitnami/mongodb