github.com/portworx/docker@v1.12.1/docs/admin/live-restore.md (about) 1 <!--[metadata]> 2 +++ 3 title = "Keep containers alive during daemon downtime" 4 description = "How to keep containers running when the daemon isn't available." 5 keywords = ["docker, upgrade, daemon, dockerd, live-restore, daemonless container"] 6 [menu.main] 7 parent = "engine_admin" 8 weight="6" 9 +++ 10 <![end-metadata]--> 11 12 # Keep containers alive during daemon downtime 13 14 By default, when the Docker daemon terminates, it shuts down running containers. 15 Starting with Docker Engine 1.12, you can configure the daemon so that containers remain 16 running if the daemon becomes unavailable. The live restore option helps reduce 17 container downtime due to daemon crashes, planned outages, or upgrades. 18 19 ## Enable the live restore option 20 21 There are two ways to enable the live restore setting to keep containers alive 22 when the daemon becomes unavailable: 23 24 * If the daemon is already running and you don't want to stop it, you can add 25 the configuration to the daemon configuration file. For example, on a linux 26 system the default configuration file is `/etc/docker/daemon.json`. 27 28 Use your favorite editor to enable the `live-restore` option in the 29 `daemon.json`. 30 31 ```bash 32 { 33 "live-restore": true 34 } 35 ``` 36 37 You have to send a `SIGHUP` signal to the daemon process for it to reload the 38 configuration. For more information on how to configure the Docker daemon using 39 config.json, see [daemon configuration file](../reference/commandline/dockerd.md#daemon-configuration-file). 40 41 * When you start the Docker daemon, pass the `--live-restore` flag: 42 43 ```bash 44 $ sudo dockerd --live-restore 45 ``` 46 47 ## Live restore during upgrades 48 49 The live restore feature supports restoring containers to the daemon for 50 upgrades from one minor release to the next. For example from Docker Engine 51 1.12.1 to 1.13.2. 52 53 If you skip releases during an upgrade, the daemon may not restore connection 54 the containers. If the daemon is unable restore connection, it ignores the 55 running containers and you must manage them manually. The daemon won't shut down 56 the disconnected containers. 57 58 ## Live restore upon restart 59 60 The live restore option only works to restore the same set of daemon options 61 as the daemon had before it stopped. For example, live restore may not work if 62 the daemon restarts with a different bridge IP or a different graphdriver. 63 64 ## Impact of live restore on running containers 65 66 A lengthy absence of the daemon can impact running containers. The containers 67 process writes to FIFO logs for daemon consumption. If the daemon is unavailable 68 to consume the output, the buffer will fill up and block further writes to the 69 log. A full log blocks the process until further space is available. The default 70 buffer size is typically 64K. 71 72 You must restart Docker to flush the buffers. 73 74 You can modify the kernel's buffer size by changing `/proc/sys/fs/pipe-max-size`. 75 76 ## Live restore and swarm mode 77 78 The live restore option is not compatible with Docker Engine swarm mode. When 79 the Docker Engine runs in swarm mode, the orchestration feature manages tasks 80 and keeps containers running according to a service specification.