What is the best way to provision failover for my services? reddit / selfhosted ---------------------------------------------------------------------- Loren-DB · 2023-12-27 20:41 All my services are deployed as docker-compose files on a single server running openSUSE Tumbleweed. I'm thinking about setting up redundancy so if the server goes down, a backup machine can take over. What options do I have and what is the most realistic option? So far I've been looking primarily into Docker Swarm and Proxmox, but both seem to have drawbacks here. Docker Swarm apparently won't provide high availability for app databases, while Proxmox would likely require me to reinstall my server from scratch, which is also not the most awesome solution ever (although I could probably \`dd\` my storage to a different machine to keep everything up while I installed Proxmox). ---------------------------------------------------------------------- stephenc01 · 2023-12-27 21:25 I did a docker swarm with glusterfs it’s automatic failover. I had to tweak the db settings to avoid corruption. There is also a bug in older Mariadb code make sure your running the latest. Of course backups; the databases ate themselves a couple times during outages. ---------------------------------------------------------------------- PaulEngineer-89 · 2023-12-27 21:40 Kubernetes is the standard. Docker Swarm is slowly going away. If all your containers already have docker-compose files you are good to go. Fundamentally the problem with failovers is stable storage and getting the failover stuff configured. I mean if you have just one instance running it has to store data somewhere. ---------------------------------------------------------------------- adamshand · 2023-12-27 23:02 Docker Swarm is delightfully simple and provides failover for containers that do *NOT* require persistent storage. If you want to be able to failover containers that require persistant storage, eg. databases, you have a few options. The simplest is probably a shared NFS filesystem. Another option is a clustered filesystem like Gluster or Ceph (good info at [Funky Penguin](https://geek-cookbook.funkypenguin.co.nz/docker- swarm/design/)). I'm currently playing with the [Docker plugin for Rclone](https://rclone.org/docker), not sure how reliable it is yet, but it's working. ---------------------------------------------------------------------- electronicoldmen · 2023-12-28 00:17 Swarm was DOA. I've never seen it in serious use during my career as a DevOps person. The only place I still see it mentioned in a positive light and as something people use is in this sub. ---------------------------------------------------------------------- 5N4K3ii · 2023-12-29 03:49 Depends on how fancy you want your failover to be. Kubernetes config and cluster can be confusing to get set up. I have a nas for storage and ran docker containers on another machine using the nas for storage when I started playing with two apps. Eventually we started using the apps regularly enough I wanted failover in case I wasn't home if/when the containers went down (hypothetical, it hasn't happened yet). My homelab is not exposed to the internet. I had a raspberry pi 4 being unused and got a pi5 for Christmas so I loaded up the same containers on the 5 that the other app box was running. The pi 4 got loaded with nothing but raspbian, acme.sh (for letsencrypt certificates), and nginx. The pi4 reverse proxies to the main app box with the pi5 as 'backup' so the pi5 only gets hit if the main app box doesn't respond. All clients are directed to the pi4/proxy. I'm reasonably safe from colliding writes because traffic only goes to one box at a time and the two apps I'm running are jellyfin and vaultwarden which are mostly read services with occasional writes. If I were wanting to have failover for something that had moderate to high write activity I'd be more concerned about potential write collisions and sync issues during a failover situation.