docker service for mongodb
Youu should have pre-installed java, maven, docker
-
Run mongodb & java app.
docker-compose up -d --build
access link
http://docker-machine-ip:5008/api/v2/person/save // save 10000 record to mongodb http://192.168.99.100:5008/api/v2/person/find/age?age=18http://192.168.99.100:5008/api/v2/person/find/age/range?startAge=11&endAge=100
##################### How to scale mongoDB using docker !!!
-
Create mongodb service
docker service create --name mongodb mongo
-
Scale MongoDB
docker service scale mongodb=3
-
docker services list
docker service ls
-
remove docker service
docker service rm mongodb
-
create docker service replicas
docker service create --name supermongo --replicas=5 mongo
-
Change replicas count:
docker service update --replicas 3 supermongo