Getting to know Docker… and God knows what else [Part 2]

Container Orchestration

From: http://arunkottolli.blogspot.com/2017/11/container-ecosystem.html

Lab 1: Generate a swarm

docker swarm init --advertise-addr eth0
Swarm initialized: current node (zfjd0jzs9ikzpcpqzcyqwa9q2) is now a manager.To add a worker to this swarm, run the following command:docker swarm join --token SWMTKN-1-0w342gm5h9wz43d84nr35dkg0ir8xvk8tg6muc7hr9ndtuchi4-3o72xfut0lk6b43a2l5a0v4ec 192.168.0.23:2377To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

Pause

Back to it

From the docs, an image of a service distributing tasks to containers running on each node.
docker service create --detach=true --name nginx1 --publish 80:80   --mount source=/etc/hostname,target=/usr/share/nginx/html/index.html,type=bind,ro nginx:1.12

Scale

docker service update --replicas=5 --detach=true nginx1
docker service ps nginx1

Updates

docker service update --image nginx:1.13 --detach=true nginx1

Having Issues

Thinking availability

  • Start with 5 — Manager 1 — Saved in the database
  • Add 2 — Manager 1 — Saved in the database
  • Minus 1 — Manager 2 —Not saved in the database
  • Divide by 2 — Manager 1 — Saved in the database

What does this all boil down to?

  • Use 3 managers and they will survive 1 breaking
  • Use 5 managers and they will survive 2 breaking
  • Use 7 managers and they will survive 3 breaking

Summary

--

--

--

Focused on saving our time: everyhour.xyz for your life balance; tree-meals-a-day.earth for our food emissions and compairbnb.info/hello for booking airbnbs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Team vs Individual Ownership

5 Advanced and In-Depth Learning Resources for Vue.js

NFT Explained

How I’m testing my Cubits

CS371p Spring 2021 Blog #3

Abusing C++ threads to learn how they work

Easy facial detection in your Laravel PHP application

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ACGoff

ACGoff

Focused on saving our time: everyhour.xyz for your life balance; tree-meals-a-day.earth for our food emissions and compairbnb.info/hello for booking airbnbs.

More from Medium

How to Upload files to s3 using Python||AWS

python || AWS

Docker in a Nutshell

How to connect to a MySQL database using C# and WindowsForms

How to Install XAMPP Stack on Ubuntu 18.04