You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
now edit rest-count/main.py (for example, you can increase the version to 1.1)
docker build -t francescou/rest-count:legacy rest-count/
docker-compose -f application/docker-compose.yml up -d restcountprimary
sleep 15
docker-compose -f application/docker-compose.yml up -d restcountbackup
the updated microservice will be deployed with no downtime.
You can also modify the rest-ip microservice in the same way (see rest-ip/app.js).
Scaling microservices
this section will explain how to can scale up and down docker-compose services.
open your browser to https://localhost:8500/ui/. There you will find a rest-count service, running on two nodes (one primary and one backup). Note that each node is a Docker container. Execute
check again https://localhost:8500/ui to ensure that there are now four rest-count instance (three primary and one backup).
Make a few requests to https://localhost:8080/api/v1/count and then run docker-compose -f application/docker-compose.yml logs to see how requests are processed by different rest-count instances.
You can now scale down the rest-count service without having any down time, e.g.: