Hello everyone,
I’m a newbie with docker in production as I’ve been only using docker in dev environment for last 6,8 months, our Current environment is basically a local setup of everything as its a secure system not meant to use over the internet,
Now i want to use docker for production as well as I’ve satrted to convert my windows based exes to linux ones so going all in for that.
My question is whether it is suitable for me to deploy using docker or not my main requirements are reliability and redundancy.
I have one windows based application with below dependcies.
Say i will have two machines for these dependcies these are some minimum apps i need inside one system
1 kafka server
1 Database
Say 10 services exes
Same for the second setup my main hub is kafka for data distribution and redundancy is all handled i when ones down either bcz of networking or other crashes other will go up vice versa.
Here is what i understood two compose files for both machines making sure all the communication btw them is sorted. Previously I’ve used two linux machines to deploy them so have to manage everything for each service and app making it difficult for user to setup or incase something goes wrong.
Redundancy is not easy. What does it even mean for you? Have a backup? Or have high availability, all services always available?
Docker is great, it was made for Linux. So for production, you should not use developer tool Docker Desktop, but real Linux servers with Docker Engine.
We run services with high availability on Docker Swarm. We have an external managed load balancer, so the gate (domain pointing to a single IP) always works. Our services run in Docker Swarm cluster of 3 nodes, usually 3 instances, so one node can die. The same for our database. Services available 24x7.
Docker Swarm is old school, very few new features, but it runs reliably for us, maybe for that reason.
The other option is Kubernetes, or smaller k3s, but it has many more moving parts, APIs are changing, it’s way more complex, they say you need 2 FTE to manage.
Ok i understand it now ,
Can you comment on why docker swarm is better than compose for production if i only need 2 node setup currently we’ve handled redundancy manually so its just i want to know about it s deployment.
A point to be noted is our whole production setup is off the grid and for a single entity.
Air gapped environments are not unusual. If done right, a private container registry is operated in the air gapped environment, so that public and self created images can be stored there, and pulled from there during container deployment.
Swarm has better self-healing capabilities, as in: if one node dies, the payload of the node will be deployed on the other health nodes. Swarm is not recommended for a 2 node setup, as it requires floor(n/2)+1 healthy manager nodes to do its work.
Compose is great. The question is what you want to achieve. What is redundancy for you?
When you have a software on site, server 1 breaks, they call someone, it takes an hour, server two is started, then that is fine.
If you want high availability, as in no interruption, than that’s a different topic, and you probably need 3 servers to find consensus.
And for redundancy, always make sure it’s not only the app, but also dependencies like database and file storage that should be redundant.
Also note that a redundant server is not a backup. They are probably both connected to power and network for syncing of data. When lightning strikes they might be gone. So always ensure an offline/offsite backup.