i have ubuntu server with docker swarm onboard, with many hosts, web applications, etc.…
- User
i have ubuntu server with docker swarm onboard, with many hosts, web applications, etc. how to apt upgrade properly without stopping services
- Assistant
i have ubuntu server with docker swarm onboard, with many hosts, web applications, etc. how to apt upgrade properly without stopping services
Upgrading packages on an Ubuntu server, especially one that hosts critical services using Docker Swarm, requires careful planning to minimize downtime and ensure continuity of your services. Here's a general approach to performing an apt upgrade with minimal service disruption:
Before upgrading, ensure you have:
Leverage Docker Swarm's high availability features:
Perform rolling upgrades for each node to minimize the impact on your services:
Put Node in Drain Mode:
docker node update --availability drain <NODE-ID>
Upgrade the Node:
sudo apt update
sudo apt upgrade
sudo reboot or check for a reboot prompt after the upgrade.Re-enable Node:
docker node update --availability active <NODE-ID>
Check Services:
docker service ls and docker service ps <SERVICE-ID> for verification.Repeat for Other Nodes:
Ensure all systems are backed-up as expected after the upgrade and configurations are intact.
By following this approach, you can minimize the downtime and impact of an apt upgrade on your Docker Swarm-managed Ubuntu servers.
Not yet included in a published release.