0

I currently run a number of docker containers on a few hosts, in my home lab, in a standalone fashion. These hosts have docker ce installed and are not configured in any swarm or cluster mode. The containers running use an NFS share to store configuration information, such as Plex etc and are configured in Host mode so that access to the container is via the Host IP.

Example config:

docker run \
-d \
--name plex \
--network=host \
-e TZ="<timezone>" \
-e PLEX_CLAIM="<claimToken>" \
-v <path/to/plex/database>:/config \
-v <path/to/transcode/temp>:/transcode \
-v <path/to/media>:/data \
plexinc/pms-docker

What I'm interested in doing, is running these containers in a high availability mode whereby, if Plex is running on host A and that host becomes unavailable, the Plex container will automatically start up on another host and remain accessible.

I've been doing some research and understand that this likely involves creation of a docker swarm with 1 manager and 2 workers (to begin with), then the creation of a docker overlay network to which the containers will be associated with. While looking around for information and tutorials etc, I have not seen any examples using docker run when using and starting containers in swarm mode but rather the containers are started as services (or as a stack which is a collection of services). These 'services' are typically application components or workers as opposed to an entire application and I've also read that docker services cannot be attributed a static IP address so I'm unsure how this would work with HA? I was planning to assign the various containers with a static IP that I'd use to connect to from clients and it wouldn't matter which host was currently hosting the container within the swarm.

Any pointers or tips much appreciated.

Rob Berry
  • 185
  • 1
  • 4
  • 14
  • What about simple restart policies – Shawn C. Mar 25 '18 at 14:32
  • I do use `restart=always` which works for a crash of the container but looking for something a bit more robust so that containers can be up on any machine in a swarm but have the same IP etc. – Rob Berry Mar 25 '18 at 17:54
  • I guess in docker swarm mode, if the services are in the same docker network, you can use service's name instead of IPs. – hichamx Mar 28 '18 at 10:50

0 Answers0