Install Docker on each server.
Run manager node:
docker swarm init --advertise-addr=xxx.xxx.xxx.xxx
Connect worker nodes:
docker swarm join --token <token> xxx.xxx.xxx.xxx:2377
Run stack:
docker stack deploy --compose-file docker-compose.yml wpstack
Re-scale wordpress service:
docker service scale wpstack_wordpress=4
Update wordpress service image:
docker service update wpstack_wordpress
Remove stack:
docker stack rm wpstack
- encrypted overlay network
- wordpress volume mounted to a shared persistance storage array
- database performance configured for a server with 4CPUs and 8GB of RAM
This configuration is intended to run behind a proxy with SSL and a firewall.
Image is showing the stack running on three Ubuntu demo servers. Database is on the manager node, and two wordpress instances on each worker node.
- https://maddevs.io/blog/deploy-and-scale-wordpress-with-docker-cloud-swarm-mode/
- https://hackernoon.com/architecting-a-highly-available-and-scalable-wordpress-using-docker-swarm-traefik-glusterfs-a69186e9f0e
- https://thenewstack.io/tutorial-create-a-docker-swarm-with-persistent-storage-using-glusterfs/
- https://www.digitalocean.com/community/tutorials/how-to-configure-the-linux-firewall-for-docker-swarm-on-ubuntu-16-04