Usage: ./start.sh <docker hub repo name>
The script will deploy a 3-node MongoDB replica set as described in https://docs.mongodb.com/manual/replication/ to the Docker Swarm cluster.
- At least 3-node Docker Swarm cluster (tested on docker-ce 18.05)
- Docker hub repository: the script builds custom MongoDB image and pushes it there so other nodes in the cluster can pull it.
- OpenSSL
- Replica set access control using keyFile;
- Client connections are SSL-secured. The script will generate all necessary crypto material using OpenSSL and print the CA cert to the console;
- Creates a user which can access the database called "mydb";
- All created users' credentials (including admin and replica set admin) are printed to console.