4 ms·
Played around rolling deployments a little using Ansible and tagged github releases. Here's a screencast with some pics for anyone who's interested @ https://sy
by WestCoastJustin 11y ago
Played around rolling deployments a little using Ansible and tagged github releases. Here's a screencast with some pics for anyone who's interested @ https://sysadmincasts.com/episodes/47-zero-downtime-deployments-with-ansible-part-4-4 https://sysadmincasts.com/episodes/47-zero-downtime-deployme...
Workflow is to just mark the node down for maintenance via socket cat, upgrade it, then mark it back on-line.
# mark node off-line
echo "disable server episode46/web1" | socat stdio /var/lib/haproxy/stats
# update app code
git pull tagged release version
# mark node on-line
echo "enable server episode46/web1" | socat stdio /var/lib/haproxy/stats
- vidarh 11y agoThat's the easy part - the tricky part is when you need to reload the haproxy config to do any of the many things you can't do over the socket.
- brianwawok 11y agoIf you have a few HA proxy nodes with DNS load balancing, wouldn't the client auto move on to another HA proxy? It is a tiny lag but shouldn't be an error.
- jeremyjh 11y agoNo, once the client has resolved the IP it will either connect to that proxy or fail that particular connection attempt. But you can use the DNS to drain a proxy before restarting it.
- vidarh 11y agoThat might have been the case if you could expect clients to be well behaved, but you can't. In my experience, hardly no network clients handle that kind of thing properly.