1

Is it possible to hotcopy a docker container? or some sort of clustering with docker for HA purposes?

Can someone simplify this?

How to scale Docker containers in production

Community
  • 1
  • 1
stashfree
  • 655
  • 6
  • 22

2 Answers2

1

Docker containers are not designed to be VMs and are not really meant for hot-copies. Instead you should define your container such that it has a well-known start state. If the container goes down the alternate should start from the well-known start state. If you need to keep track of state that the container generates at run time this has to be done externally to docker.

One option is to use volumes to mount the state (files) on to the host filesystem. Then use RAID, NTFS or any other means, to share that file system with other physical nodes. Then you can mount the same files on to a second docker container on a second host with the same state.

Depending on what you are running in your containers you can also have to state sharing inside your containers for example using mongo replication sets. To reiterate though containers are not as of yet designed to be migrated with runtime state.

Usman Ismail
  • 17,999
  • 14
  • 83
  • 165
1

There is a variety of technologies around Docker that could help, depending on what you need HA-wise.

If you simply wish to start a stateless service container on different host, you need a network overlay, such as weave.

If you wish to replicate data across for something like database failover, you need a storage solution, such as Flocker.

If you want to run multiple services and have load-balancing and forget on which host each container runs, given that X instances are up, then Kubernetes is the kind of tool you need.

It is possible to make many Docker-related tools work together, we have a few stories on our blog already.

errordeveloper
  • 6,716
  • 6
  • 41
  • 54