Browse code

add doc for live-restore setting and daemonless containers, fix admin guide menu

Signed-off-by: Charles Smith <charles.smith@docker.com>

Charles Smith authored on 2016/07/19 13:40:07
Showing 15 changed files
... ...
@@ -6,7 +6,7 @@ description = "Using the Ambassador pattern to abstract (network) services"
6 6
 keywords = ["Examples, Usage, links, docker, documentation, examples, names, name,  container naming"]
7 7
 [menu.main]
8 8
 parent = "engine_admin"
9
-weight = 6
9
+weight = 15
10 10
 +++
11 11
 <![end-metadata]-->
12 12
 
... ...
@@ -6,6 +6,7 @@ description = "Installation and using Docker via Chef"
6 6
 keywords = ["chef, installation, usage, docker,  documentation"]
7 7
 [menu.main]
8 8
 parent = "engine_admin"
9
+weight="11"
9 10
 +++
10 11
 <![end-metadata]-->
11 12
 
12 13
deleted file mode 100644
... ...
@@ -1,293 +0,0 @@
1
-<!--[metadata]>
2
-+++
3
-aliases = ["/engine/articles/configuring/"]
4
-title = "Configuring and running Docker"
5
-description = "Configuring and running the Docker daemon on various distributions"
6
-keywords = ["docker, daemon, configuration, running,  process managers"]
7
-[menu.main]
8
-parent = "engine_admin"
9
-weight = 3
10
-+++
11
-<![end-metadata]-->
12
-
13
-# Configuring and running Docker on various distributions
14
-
15
-After successfully installing Docker, the `docker` daemon runs with its default
16
-configuration.
17
-
18
-In a production environment, system administrators typically configure the
19
-`docker` daemon to start and stop according to an organization's requirements. In most
20
-cases, the system administrator configures a process manager such as `SysVinit`, `Upstart`,
21
-or `systemd` to manage the `docker` daemon's start and stop.
22
-
23
-### Running the docker daemon directly
24
-
25
-The `docker` daemon can be run directly using the `dockerd` command. By default it listens on
26
-the Unix socket `unix:///var/run/docker.sock`
27
-
28
-    $ dockerd
29
-
30
-    INFO[0000] +job init_networkdriver()
31
-    INFO[0000] +job serveapi(unix:///var/run/docker.sock)
32
-    INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
33
-    ...
34
-    ...
35
-
36
-### Configuring the docker daemon directly
37
-
38
-If you're running the `docker` daemon directly by running `docker daemon` instead
39
-of using a process manager, you can append the configuration options to the `docker` run
40
-command directly. Other options can be passed to the `docker` daemon to configure it.
41
-
42
-Some of the daemon's options are:
43
-
44
-| Flag                  | Description                                               |
45
-|-----------------------|-----------------------------------------------------------|
46
-| `-D`, `--debug=false` | Enable or disable debug mode. By default, this is false. |
47
-| `-H`,`--host=[]`      | Daemon socket(s) to connect to.                           |
48
-| `--tls=false`         | Enable or disable TLS. By default, this is false.         |
49
-
50
-
51
-Here is an example of running the `docker` daemon with configuration options:
52
-
53
-    $ dockerd -D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376
54
-
55
-These options :
56
-
57
-- Enable `-D` (debug) mode
58
-- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively
59
-- Listen for connections on `tcp://192.168.59.3:2376`
60
-
61
-The command line reference has the [complete list of daemon flags](../reference/commandline/dockerd.md)
62
-with explanations.
63
-
64
-### Daemon debugging
65
-
66
-As noted above, setting the log level of the daemon to "debug" or enabling debug mode
67
-with `-D` allows the administrator or operator to gain much more knowledge about the
68
-runtime activity of the daemon. If faced with a non-responsive daemon, the administrator
69
-can force a full stack trace of all threads to be added to the daemon log by sending the
70
-`SIGUSR1` signal to the Docker daemon. A common way to send this signal is using the `kill`
71
-command on Linux systems. For example, `kill -USR1 <daemon-pid>` sends the `SIGUSR1`
72
-signal to the daemon process, causing the stack dump to be added to the daemon log.
73
-
74
-> **Note:** The log level setting of the daemon must be at least "info" level and above for
75
-> the stack trace to be saved to the logfile. By default the daemon's log level is set to
76
-> "info".
77
-
78
-The daemon will continue operating after handling the `SIGUSR1` signal and dumping the stack
79
-traces to the log. The stack traces can be used to determine the state of all goroutines and
80
-threads within the daemon.
81
-
82
-## Ubuntu
83
-
84
-As of `14.04`, Ubuntu uses Upstart as a process manager. By default, Upstart jobs
85
-are located in  `/etc/init` and the `docker` Upstart job can be found at `/etc/init/docker.conf`.
86
-
87
-After successfully [installing Docker for Ubuntu](../installation/linux/ubuntulinux.md),
88
-you can check the running status using Upstart in this way:
89
-
90
-    $ sudo status docker
91
-
92
-    docker start/running, process 989
93
-
94
-### Running Docker
95
-
96
-You can start/stop/restart the `docker` daemon using
97
-
98
-    $ sudo start docker
99
-
100
-    $ sudo stop docker
101
-
102
-    $ sudo restart docker
103
-
104
-
105
-### Configuring Docker
106
-
107
-The instructions below depict configuring Docker on a system that uses `upstart`
108
-as the process manager. As of Ubuntu 15.04, Ubuntu uses `systemd` as its process
109
-manager. For Ubuntu 15.04 and higher, refer to [control and configure Docker with systemd](systemd.md).
110
-
111
-You configure the `docker` daemon in the `/etc/default/docker` file on your
112
-system. You do this by specifying values in a `DOCKER_OPTS` variable.
113
-
114
-To configure Docker options:
115
-
116
-1. Log into your host as a user with `sudo` or `root` privileges.
117
-
118
-2. If you don't have one, create the `/etc/default/docker` file on your host. Depending on how
119
-you installed Docker, you may already have this file.
120
-
121
-3. Open the file with your favorite editor.
122
-
123
-    ```
124
-    $ sudo vi /etc/default/docker
125
-    ```
126
-
127
-4. Add a `DOCKER_OPTS` variable with the following options. These options are appended to the
128
-`docker` daemon's run command.
129
-
130
-```
131
-    DOCKER_OPTS="-D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376"
132
-```
133
-
134
-These options :
135
-
136
-- Enable `-D` (debug) mode
137
-- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively
138
-- Listen for connections on `tcp://192.168.59.3:2376`
139
-
140
-The command line reference has the [complete list of daemon flags](../reference/commandline/dockerd.md)
141
-with explanations.
142
-
143
-
144
-5. Save and close the file.
145
-
146
-6. Restart the `docker` daemon.
147
-
148
-    ```
149
-    $ sudo restart docker
150
-    ```
151
-
152
-7. Verify that the `docker` daemon is running as specified with the `ps` command.
153
-
154
-    ```
155
-    $ ps aux | grep docker | grep -v grep
156
-    ```
157
-
158
-### Logs
159
-
160
-By default logs for Upstart jobs are located in `/var/log/upstart` and the logs for `docker` daemon
161
-can be located at `/var/log/upstart/docker.log`
162
-
163
-    $ tail -f /var/log/upstart/docker.log
164
-    INFO[0000] Loading containers: done.
165
-    INFO[0000] Docker daemon commit=1b09a95-unsupported graphdriver=aufs version=1.11.0-dev
166
-    INFO[0000] +job acceptconnections()
167
-    INFO[0000] -job acceptconnections() = OK (0)
168
-    INFO[0000] Daemon has completed initialization
169
-
170
-
171
-## CentOS / Red Hat Enterprise Linux / Fedora
172
-
173
-As of `7.x`, CentOS and RHEL use `systemd` as the process manager. As of `21`, Fedora uses
174
-`systemd` as its process manager.
175
-
176
-After successfully installing Docker for [CentOS](../installation/linux/centos.md)/[Red Hat Enterprise Linux](../installation/linux/rhel.md)/[Fedora](../installation/linux/fedora.md), you can check the running status in this way:
177
-
178
-    $ sudo systemctl status docker
179
-
180
-### Running Docker
181
-
182
-You can start/stop/restart the `docker` daemon using
183
-
184
-    $ sudo systemctl start docker
185
-
186
-    $ sudo systemctl stop docker
187
-
188
-    $ sudo systemctl restart docker
189
-
190
-If you want Docker to start at boot, you should also:
191
-
192
-    $ sudo systemctl enable docker
193
-
194
-### Configuring Docker
195
-
196
-For CentOS 7.x and RHEL 7.x you can [control and configure Docker with systemd](systemd.md).
197
-
198
-Previously, for CentOS 6.x and RHEL 6.x you would configure the `docker` daemon in
199
-the `/etc/sysconfig/docker` file on your system. You would do this by specifying
200
-values in a `other_args` variable. For a short time in CentOS 7.x and RHEL 7.x you
201
-would specify values in a `OPTIONS` variable. This is no longer recommended in favor
202
-of using systemd directly.
203
-
204
-For this section, we will use CentOS 7.x as an example to configure the `docker` daemon.
205
-
206
-To configure Docker options:
207
-
208
-1. Log into your host as a user with `sudo` or `root` privileges.
209
-
210
-2. Create the `/etc/systemd/system/docker.service.d` directory.
211
-
212
-    ```
213
-    $ sudo mkdir /etc/systemd/system/docker.service.d
214
-    ```
215
-
216
-3. Create a  `/etc/systemd/system/docker.service.d/docker.conf` file.
217
-
218
-4. Open the file with your favorite editor.
219
-
220
-    ```
221
-    $ sudo vi /etc/systemd/system/docker.service.d/docker.conf
222
-    ```
223
-
224
-5. Override the `ExecStart` configuration from your `docker.service` file to customize
225
-the `docker` daemon. To modify the `ExecStart` configuration you have to specify
226
-an empty configuration followed by a new one as follows:
227
-
228
-```
229
-[Service]
230
-ExecStart=
231
-ExecStart=/usr/bin/dockerd -H fd:// -D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376
232
-```
233
-
234
-These options :
235
-
236
-- Enable `-D` (debug) mode
237
-- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively
238
-- Listen for connections on `tcp://192.168.59.3:2376`
239
-
240
-The command line reference has the [complete list of daemon flags](../reference/commandline/dockerd.md)
241
-with explanations.
242
-
243
-6. Save and close the file.
244
-
245
-7. Flush changes.
246
-
247
-    ```
248
-    $ sudo systemctl daemon-reload
249
-    ```
250
-
251
-8. Restart the `docker` daemon.
252
-
253
-    ```
254
-    $ sudo systemctl restart docker
255
-    ```
256
-
257
-9. Verify that the `docker` daemon is running as specified with the `ps` command.
258
-
259
-    ```
260
-    $ ps aux | grep docker | grep -v grep
261
-    ```
262
-
263
-### Logs
264
-
265
-systemd has its own logging system called the journal. The logs for the `docker` daemon can
266
-be viewed using `journalctl -u docker`
267
-
268
-    $ sudo journalctl -u docker
269
-    May 06 00:22:05 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
270
-    May 06 00:22:05 localhost.localdomain docker[2495]: time="2015-05-06T00:22:05Z" level="info" msg="+job serveapi(unix:///var/run/docker.sock)"
271
-    May 06 00:22:05 localhost.localdomain docker[2495]: time="2015-05-06T00:22:05Z" level="info" msg="Listening for HTTP on unix (/var/run/docker.sock)"
272
-    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="+job init_networkdriver()"
273
-    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="-job init_networkdriver() = OK (0)"
274
-    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="Loading containers: start."
275
-    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="Loading containers: done."
276
-    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="Docker daemon commit=1b09a95-unsupported graphdriver=aufs version=1.11.0-dev"
277
-    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="+job acceptconnections()"
278
-    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="-job acceptconnections() = OK (0)"
279
-
280
-_Note: Using and configuring journal is an advanced topic and is beyond the scope of this article._
281
-
282
-
283
-### Daemonless Containers
284
-
285
-Starting with Docker 1.12 containers can run without Docker or containerd running.  This allows the 
286
-Docker daemon to exit, be upgraded, or recover from a crash without affecting running containers 
287
-on the system.  To enable this functionality you need to add the `--live-restore` flag when
288
-launching `dockerd`.  This will ensure that Docker does not kill containers on graceful shutdown or
289
-on restart leaving the containers running.
290
-
291
-While the Docker daemon is down logging will still be captured, however, it will be capped at the kernel's pipe buffer size before the buffer fills up, blocking the process.
292
-Docker will need to be restarted to flush these buffers.
293
-You can modify the kernel's buffer size by changing `/proc/sys/fs/pipe-max-size`.
... ...
@@ -6,6 +6,7 @@ description = "Using DSC to configure a new Docker host"
6 6
 keywords = ["powershell, dsc, installation, usage, docker,  documentation"]
7 7
 [menu.main]
8 8
 parent = "engine_admin"
9
+weight="10"
9 10
 +++
10 11
 <![end-metadata]-->
11 12
 
... ...
@@ -5,7 +5,7 @@ description = "CLI and log output formatting reference"
5 5
 keywords = ["format, formatting, output, templates, log"]
6 6
 [menu.main]
7 7
 parent = "engine_admin"
8
-weight=-90
8
+weight=7
9 9
 +++
10 10
 <![end-metadata]-->
11 11
 
... ...
@@ -6,6 +6,7 @@ description = "How to generate scripts for upstart, systemd, etc."
6 6
 keywords = ["systemd, upstart, supervisor, docker, documentation,  host integration"]
7 7
 [menu.main]
8 8
 parent = "engine_admin"
9
+weight="5"
9 10
 +++
10 11
 <![end-metadata]-->
11 12
 
... ...
@@ -1,11 +1,283 @@
1
-<!-- [metadata]>
1
+<!--[metadata]>
2 2
 +++
3
-title = "Administrate"
4
-description = "Administrate"
5
-keywords = ["Administrate"]
3
+aliases = [
4
+  "/engine/articles/configuring/",
5
+  "/engine/admin/configuring/"
6
+  ]
7
+title = "Configuring and running Docker"
8
+description = "Configuring and running the Docker daemon on various distributions"
9
+keywords = ["docker, daemon, configuration, running,  process managers"]
6 10
 [menu.main]
7
-parent="engine_use"
8
-identifier="engine_admin"
9
-weight="-70"
11
+parent = "engine_admin"
12
+weight = 0
10 13
 +++
11 14
 <![end-metadata]-->
15
+
16
+# Configuring and running Docker on various distributions
17
+
18
+After successfully installing Docker, the `docker` daemon runs with its default
19
+configuration.
20
+
21
+In a production environment, system administrators typically configure the
22
+`docker` daemon to start and stop according to an organization's requirements. In most
23
+cases, the system administrator configures a process manager such as `SysVinit`, `Upstart`,
24
+or `systemd` to manage the `docker` daemon's start and stop.
25
+
26
+### Running the docker daemon directly
27
+
28
+The `docker` daemon can be run directly using the `dockerd` command. By default it listens on
29
+the Unix socket `unix:///var/run/docker.sock`
30
+
31
+    $ dockerd
32
+
33
+    INFO[0000] +job init_networkdriver()
34
+    INFO[0000] +job serveapi(unix:///var/run/docker.sock)
35
+    INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
36
+    ...
37
+    ...
38
+
39
+### Configuring the docker daemon directly
40
+
41
+If you're running the `docker` daemon directly by running `docker daemon` instead
42
+of using a process manager, you can append the configuration options to the `docker` run
43
+command directly. Other options can be passed to the `docker` daemon to configure it.
44
+
45
+Some of the daemon's options are:
46
+
47
+| Flag                  | Description                                               |
48
+|-----------------------|-----------------------------------------------------------|
49
+| `-D`, `--debug=false` | Enable or disable debug mode. By default, this is false. |
50
+| `-H`,`--host=[]`      | Daemon socket(s) to connect to.                           |
51
+| `--tls=false`         | Enable or disable TLS. By default, this is false.         |
52
+
53
+
54
+Here is an example of running the `docker` daemon with configuration options:
55
+
56
+    $ dockerd -D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376
57
+
58
+These options :
59
+
60
+- Enable `-D` (debug) mode
61
+- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively
62
+- Listen for connections on `tcp://192.168.59.3:2376`
63
+
64
+The command line reference has the [complete list of daemon flags](../reference/commandline/dockerd.md)
65
+with explanations.
66
+
67
+### Daemon debugging
68
+
69
+As noted above, setting the log level of the daemon to "debug" or enabling debug mode
70
+with `-D` allows the administrator or operator to gain much more knowledge about the
71
+runtime activity of the daemon. If faced with a non-responsive daemon, the administrator
72
+can force a full stack trace of all threads to be added to the daemon log by sending the
73
+`SIGUSR1` signal to the Docker daemon. A common way to send this signal is using the `kill`
74
+command on Linux systems. For example, `kill -USR1 <daemon-pid>` sends the `SIGUSR1`
75
+signal to the daemon process, causing the stack dump to be added to the daemon log.
76
+
77
+> **Note:** The log level setting of the daemon must be at least "info" level and above for
78
+> the stack trace to be saved to the logfile. By default the daemon's log level is set to
79
+> "info".
80
+
81
+The daemon will continue operating after handling the `SIGUSR1` signal and dumping the stack
82
+traces to the log. The stack traces can be used to determine the state of all goroutines and
83
+threads within the daemon.
84
+
85
+## Ubuntu
86
+
87
+As of `14.04`, Ubuntu uses Upstart as a process manager. By default, Upstart jobs
88
+are located in  `/etc/init` and the `docker` Upstart job can be found at `/etc/init/docker.conf`.
89
+
90
+After successfully [installing Docker for Ubuntu](../installation/linux/ubuntulinux.md),
91
+you can check the running status using Upstart in this way:
92
+
93
+    $ sudo status docker
94
+
95
+    docker start/running, process 989
96
+
97
+### Running Docker
98
+
99
+You can start/stop/restart the `docker` daemon using
100
+
101
+    $ sudo start docker
102
+
103
+    $ sudo stop docker
104
+
105
+    $ sudo restart docker
106
+
107
+
108
+### Configuring Docker
109
+
110
+The instructions below depict configuring Docker on a system that uses `upstart`
111
+as the process manager. As of Ubuntu 15.04, Ubuntu uses `systemd` as its process
112
+manager. For Ubuntu 15.04 and higher, refer to [control and configure Docker with systemd](systemd.md).
113
+
114
+You configure the `docker` daemon in the `/etc/default/docker` file on your
115
+system. You do this by specifying values in a `DOCKER_OPTS` variable.
116
+
117
+To configure Docker options:
118
+
119
+1. Log into your host as a user with `sudo` or `root` privileges.
120
+
121
+2. If you don't have one, create the `/etc/default/docker` file on your host. Depending on how
122
+you installed Docker, you may already have this file.
123
+
124
+3. Open the file with your favorite editor.
125
+
126
+    ```
127
+    $ sudo vi /etc/default/docker
128
+    ```
129
+
130
+4. Add a `DOCKER_OPTS` variable with the following options. These options are appended to the
131
+`docker` daemon's run command.
132
+
133
+```
134
+    DOCKER_OPTS="-D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376"
135
+```
136
+
137
+These options :
138
+
139
+- Enable `-D` (debug) mode
140
+- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively
141
+- Listen for connections on `tcp://192.168.59.3:2376`
142
+
143
+The command line reference has the [complete list of daemon flags](../reference/commandline/dockerd.md)
144
+with explanations.
145
+
146
+
147
+5. Save and close the file.
148
+
149
+6. Restart the `docker` daemon.
150
+
151
+    ```
152
+    $ sudo restart docker
153
+    ```
154
+
155
+7. Verify that the `docker` daemon is running as specified with the `ps` command.
156
+
157
+    ```
158
+    $ ps aux | grep docker | grep -v grep
159
+    ```
160
+
161
+### Logs
162
+
163
+By default logs for Upstart jobs are located in `/var/log/upstart` and the logs for `docker` daemon
164
+can be located at `/var/log/upstart/docker.log`
165
+
166
+    $ tail -f /var/log/upstart/docker.log
167
+    INFO[0000] Loading containers: done.
168
+    INFO[0000] Docker daemon commit=1b09a95-unsupported graphdriver=aufs version=1.11.0-dev
169
+    INFO[0000] +job acceptconnections()
170
+    INFO[0000] -job acceptconnections() = OK (0)
171
+    INFO[0000] Daemon has completed initialization
172
+
173
+
174
+## CentOS / Red Hat Enterprise Linux / Fedora
175
+
176
+As of `7.x`, CentOS and RHEL use `systemd` as the process manager. As of `21`, Fedora uses
177
+`systemd` as its process manager.
178
+
179
+After successfully installing Docker for [CentOS](../installation/linux/centos.md)/[Red Hat Enterprise Linux](../installation/linux/rhel.md)/[Fedora](../installation/linux/fedora.md), you can check the running status in this way:
180
+
181
+    $ sudo systemctl status docker
182
+
183
+### Running Docker
184
+
185
+You can start/stop/restart the `docker` daemon using
186
+
187
+    $ sudo systemctl start docker
188
+
189
+    $ sudo systemctl stop docker
190
+
191
+    $ sudo systemctl restart docker
192
+
193
+If you want Docker to start at boot, you should also:
194
+
195
+    $ sudo systemctl enable docker
196
+
197
+### Configuring Docker
198
+
199
+For CentOS 7.x and RHEL 7.x you can [control and configure Docker with systemd](systemd.md).
200
+
201
+Previously, for CentOS 6.x and RHEL 6.x you would configure the `docker` daemon in
202
+the `/etc/sysconfig/docker` file on your system. You would do this by specifying
203
+values in a `other_args` variable. For a short time in CentOS 7.x and RHEL 7.x you
204
+would specify values in a `OPTIONS` variable. This is no longer recommended in favor
205
+of using systemd directly.
206
+
207
+For this section, we will use CentOS 7.x as an example to configure the `docker` daemon.
208
+
209
+To configure Docker options:
210
+
211
+1. Log into your host as a user with `sudo` or `root` privileges.
212
+
213
+2. Create the `/etc/systemd/system/docker.service.d` directory.
214
+
215
+    ```
216
+    $ sudo mkdir /etc/systemd/system/docker.service.d
217
+    ```
218
+
219
+3. Create a  `/etc/systemd/system/docker.service.d/docker.conf` file.
220
+
221
+4. Open the file with your favorite editor.
222
+
223
+    ```
224
+    $ sudo vi /etc/systemd/system/docker.service.d/docker.conf
225
+    ```
226
+
227
+5. Override the `ExecStart` configuration from your `docker.service` file to customize
228
+the `docker` daemon. To modify the `ExecStart` configuration you have to specify
229
+an empty configuration followed by a new one as follows:
230
+
231
+```
232
+[Service]
233
+ExecStart=
234
+ExecStart=/usr/bin/dockerd -H fd:// -D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376
235
+```
236
+
237
+These options :
238
+
239
+- Enable `-D` (debug) mode
240
+- Set `tls` to true with the server certificate and key specified using `--tlscert` and `--tlskey` respectively
241
+- Listen for connections on `tcp://192.168.59.3:2376`
242
+
243
+The command line reference has the [complete list of daemon flags](../reference/commandline/dockerd.md)
244
+with explanations.
245
+
246
+6. Save and close the file.
247
+
248
+7. Flush changes.
249
+
250
+    ```
251
+    $ sudo systemctl daemon-reload
252
+    ```
253
+
254
+8. Restart the `docker` daemon.
255
+
256
+    ```
257
+    $ sudo systemctl restart docker
258
+    ```
259
+
260
+9. Verify that the `docker` daemon is running as specified with the `ps` command.
261
+
262
+    ```
263
+    $ ps aux | grep docker | grep -v grep
264
+    ```
265
+
266
+### Logs
267
+
268
+systemd has its own logging system called the journal. The logs for the `docker` daemon can
269
+be viewed using `journalctl -u docker`
270
+
271
+    $ sudo journalctl -u docker
272
+    May 06 00:22:05 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
273
+    May 06 00:22:05 localhost.localdomain docker[2495]: time="2015-05-06T00:22:05Z" level="info" msg="+job serveapi(unix:///var/run/docker.sock)"
274
+    May 06 00:22:05 localhost.localdomain docker[2495]: time="2015-05-06T00:22:05Z" level="info" msg="Listening for HTTP on unix (/var/run/docker.sock)"
275
+    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="+job init_networkdriver()"
276
+    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="-job init_networkdriver() = OK (0)"
277
+    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="Loading containers: start."
278
+    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="Loading containers: done."
279
+    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="Docker daemon commit=1b09a95-unsupported graphdriver=aufs version=1.11.0-dev"
280
+    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="+job acceptconnections()"
281
+    May 06 00:22:06 localhost.localdomain docker[2495]: time="2015-05-06T00:22:06Z" level="info" msg="-job acceptconnections() = OK (0)"
282
+
283
+_Note: Using and configuring journal is an advanced topic and is beyond the scope of this article._
12 284
new file mode 100644
... ...
@@ -0,0 +1,80 @@
0
+<!--[metadata]>
1
+title = "Keep containers alive during daemon downtime"
2
+description = "How to keep containers running when the daemon isn't available."
3
+keywords = ["docker, upgrade, daemon, dockerd, live-restore, daemonless container"]
4
+[menu.main]
5
+parent = "engine_admin"
6
+weight="6"
7
+<![end-metadata]-->
8
+
9
+# Keep containers alive during daemon downtime
10
+
11
+By default, when the Docker daemon terminates, it shuts down running containers.
12
+Starting with Docker Engine 1.12, you can configure the daemon so that containers remain
13
+running if the daemon becomes unavailable. The live restore option helps reduce
14
+container downtime due to daemon crashes, planned outages, or upgrades.
15
+
16
+## Enable the live restore option
17
+
18
+There are two ways to enable the live restore setting to keep containers alive
19
+when the daemon becomes unavailable:
20
+
21
+* If the daemon is already running and you don't want to stop it, you can add
22
+the configuration to the daemon configuration file. For example, on a linux
23
+system the default configuration file is `/etc/docker/daemon.json`.
24
+
25
+Use your favorite editor to enable the `live-restore` option in the
26
+`daemon.json`.
27
+
28
+```bash
29
+{
30
+"live-restore": true
31
+}
32
+```
33
+
34
+You have to send a `SIGHUP` signal to the daemon process for it to reload the
35
+configuration. For more information on how to configure the Docker daemon using
36
+config.json, see [daemon configuration file](../reference/commandline/dockerd.md#daemon-configuration-file)
37
+
38
+* When you start the Docker daemon, pass the `--live-restore` flag:
39
+
40
+    ```bash
41
+    $ sudo dockerd --live-restore
42
+    ```
43
+
44
+## Live restore during upgrades
45
+
46
+The live restore feature supports restoring containers to the daemon for
47
+upgrades from one minor release to the next. For example from Docker Engine
48
+1.12.1 to 1.13.2.
49
+
50
+If you skip releases during an upgrade, the daemon may not restore connection
51
+the containers. If the daemon is unable restore connection, it ignores the
52
+running containers and you must manage them manually. The daemon won't shut down
53
+the disconnected containers.
54
+
55
+## Live restore upon restart
56
+
57
+The live restore option only works to restore the same set of daemon options
58
+as the daemon had before it stopped. For example, live restore may not work if
59
+the daemon restarts with a different bridge IP or a different graphdriver.
60
+
61
+## Impact of live restore on running containers
62
+
63
+A lengthy absence of the daemon can impact running containers. The containers
64
+process writes to FIFO logs for daemon consumption. If the daemon is unavailable
65
+to consume the output, the buffer will fill up and block further writes to the
66
+log. A full log blocks the process until further space is available. The default
67
+buffer size is typically 64K.
68
+
69
+You must restart Docker to flush the buffers.
70
+
71
+You can modify the kernel's buffer size by changing `/proc/sys/fs/pipe-max-size`.
72
+
73
+## Live restore and swarm mode
74
+
75
+The live restore option is not compatible with Docker Engine swarm mode. When
76
+the Docker Engine runs in swarm mode, the orchestration feature manages tasks
77
+and keeps containers running according to a service specification.
... ...
@@ -7,7 +7,7 @@ keywords = [" docker, logging, driver"]
7 7
 [menu.main]
8 8
 parent = "engine_admin"
9 9
 identifier = "smn_logging"
10
-weight=8
10
+weight=9
11 11
 +++
12 12
 <![end-metadata]-->
13 13
 
14 14
new file mode 100644
... ...
@@ -0,0 +1,27 @@
0
+<!-- [metadata]>
1
+title = "Admin Guide"
2
+description = "Administer Docker"
3
+keywords = ["Administer"]
4
+type="menu"
5
+[menu.main]
6
+parent="engine_use"
7
+identifier="engine_admin"
8
+weight="-70"
9
+<![end-metadata]-->
10
+
11
+# Admin Topics
12
+
13
+* [Configuring and running Docker](index.md)
14
+* [Automatically start containers](host_integration.md)
15
+* [Keep containers alive during daemon downtime](live-restore.md)
16
+* [Control and configure Docker with systemd](systemd.md)
17
+* [Format command and log output](formatting.md)
18
+* [Run a local registry mirror](registry_mirror.md)
19
+* [PowerShell DSC Usage](dsc.md)
20
+* [Using Chef](chef.md)
21
+* [Using Puppet](puppet.md)
22
+* [Using Supervisor with Docker](using_supervisord.md)
23
+* [Runtime metrics](runmetrics.md)
24
+* [Link via an ambassador container](ambassador_pattern_linking.md)
... ...
@@ -6,6 +6,7 @@ description = "Installing and using Puppet"
6 6
 keywords = ["puppet, installation, usage, docker,  documentation"]
7 7
 [menu.main]
8 8
 parent = "engine_admin"
9
+weight="12"
9 10
 +++
10 11
 <![end-metadata]-->
11 12
 
... ...
@@ -6,7 +6,7 @@ description = "Measure the behavior of running containers"
6 6
 keywords = ["docker, metrics, CPU, memory, disk, IO, run,  runtime, stats"]
7 7
 [menu.main]
8 8
 parent = "engine_admin"
9
-weight = 4
9
+weight = 14
10 10
 +++
11 11
 <![end-metadata]-->
12 12
 
... ...
@@ -139,7 +139,7 @@ indicates the number of page faults which happened since the creation of
139 139
 the cgroup; this number can never decrease).
140 140
 
141 141
 
142
- - **cache:**  
142
+ - **cache:**
143 143
    the amount of memory used by the processes of this control group
144 144
    that can be associated precisely with a block on a block device.
145 145
    When you read from and write to files on disk, this amount will
... ...
@@ -149,16 +149,16 @@ the cgroup; this number can never decrease).
149 149
    `mmap`). It also accounts for the memory used by
150 150
    `tmpfs` mounts, though the reasons are unclear.
151 151
 
152
- - **rss:**  
152
+ - **rss:**
153 153
    the amount of memory that *doesn't* correspond to anything on disk:
154 154
    stacks, heaps, and anonymous memory maps.
155 155
 
156
- - **mapped_file:**  
156
+ - **mapped_file:**
157 157
    indicates the amount of memory mapped by the processes in the
158 158
    control group. It doesn't give you information about *how much*
159 159
    memory is used; it rather tells you *how* it is used.
160 160
 
161
- - **pgfault and pgmajfault:**  
161
+ - **pgfault and pgmajfault:**
162 162
    indicate the number of times that a process of the cgroup triggered
163 163
    a "page fault" and a "major fault", respectively. A page fault
164 164
    happens when a process accesses a part of its virtual memory space
... ...
@@ -177,10 +177,10 @@ the cgroup; this number can never decrease).
177 177
    it just has to duplicate an existing page, or allocate an empty
178 178
    page, it's a regular (or "minor") fault.
179 179
 
180
- - **swap:**  
180
+ - **swap:**
181 181
    the amount of swap currently used by the processes in this cgroup.
182 182
 
183
- - **active_anon and inactive_anon:**  
183
+ - **active_anon and inactive_anon:**
184 184
    the amount of *anonymous* memory that has been identified has
185 185
    respectively *active* and *inactive* by the kernel. "Anonymous"
186 186
    memory is the memory that is *not* linked to disk pages. In other
... ...
@@ -195,7 +195,7 @@ the cgroup; this number can never decrease).
195 195
    retagged "active". When the kernel is almost out of memory, and time
196 196
    comes to swap out to disk, the kernel will swap "inactive" pages.
197 197
 
198
- - **active_file and inactive_file:**  
198
+ - **active_file and inactive_file:**
199 199
    cache memory, with *active* and *inactive* similar to the *anon*
200 200
    memory above. The exact formula is cache = **active_file** +
201 201
    **inactive_file** + **tmpfs**. The exact rules used by the kernel
... ...
@@ -206,14 +206,14 @@ the cgroup; this number can never decrease).
206 206
    since it can be reclaimed immediately (while anonymous pages and
207 207
    dirty/modified pages have to be written to disk first).
208 208
 
209
- - **unevictable:**  
209
+ - **unevictable:**
210 210
    the amount of memory that cannot be reclaimed; generally, it will
211 211
    account for memory that has been "locked" with `mlock`.
212 212
    It is often used by crypto frameworks to make sure that
213 213
    secret keys and other sensitive material never gets swapped out to
214 214
    disk.
215 215
 
216
- - **memory and memsw limits:**  
216
+ - **memory and memsw limits:**
217 217
    These are not really metrics, but a reminder of the limits applied
218 218
    to this cgroup. The first one indicates the maximum amount of
219 219
    physical memory that can be used by the processes of this control
... ...
@@ -261,21 +261,21 @@ file in the kernel documentation, here is a short list of the most
261 261
 relevant ones:
262 262
 
263 263
 
264
- - **blkio.sectors:**  
264
+ - **blkio.sectors:**
265 265
    contain the number of 512-bytes sectors read and written by the
266 266
    processes member of the cgroup, device by device. Reads and writes
267 267
    are merged in a single counter.
268 268
 
269
- - **blkio.io_service_bytes:**  
269
+ - **blkio.io_service_bytes:**
270 270
    indicates the number of bytes read and written by the cgroup. It has
271 271
    4 counters per device, because for each device, it differentiates
272 272
    between synchronous vs. asynchronous I/O, and reads vs. writes.
273 273
 
274
- - **blkio.io_serviced:**  
274
+ - **blkio.io_serviced:**
275 275
    the number of I/O operations performed, regardless of their size. It
276 276
    also has 4 counters per device.
277 277
 
278
- - **blkio.io_queued:**  
278
+ - **blkio.io_queued:**
279 279
    indicates the number of I/O operations currently queued for this
280 280
    cgroup. In other words, if the cgroup isn't doing any I/O, this will
281 281
    be zero. Note that the opposite is not true. In other words, if
... ...
@@ -6,6 +6,7 @@ description = "Controlling and configuring Docker using systemd"
6 6
 keywords = ["docker, daemon, systemd,  configuration"]
7 7
 [menu.main]
8 8
 parent = "engine_admin"
9
+weight="7"
9 10
 +++
10 11
 <![end-metadata]-->
11 12
 
... ...
@@ -6,6 +6,7 @@ description = "How to use Supervisor process management with Docker"
6 6
 keywords = ["docker, supervisor,  process management"]
7 7
 [menu.main]
8 8
 parent = "engine_admin"
9
+weight="13"
9 10
 +++
10 11
 <![end-metadata]-->
11 12
 
... ...
@@ -56,7 +56,7 @@ Options:
56 56
       --ipv6                                 Enable IPv6 networking
57 57
       -l, --log-level=info                   Set the logging level
58 58
       --label=[]                             Set key=value labels to the daemon
59
-      --live-restore                         Enable live restore of docker when containers are still running
59
+      --live-restore                         Enables keeping containers alive during daemon downtime
60 60
       --log-driver=json-file                 Default driver for container logs
61 61
       --log-opt=map[]                        Default log driver options for containers
62 62
       --max-concurrent-downloads=3           Set the max concurrent downloads for each pull
... ...
@@ -1002,14 +1002,14 @@ via flags. The docker daemon fails to start if an option is duplicated between
1002 1002
 the file and the flags, regardless their value. We do this to avoid
1003 1003
 silently ignore changes introduced in configuration reloads.
1004 1004
 For example, the daemon fails to start if you set daemon labels
1005
-in the configuration file and also set daemon labels via the `--label` flag. 
1005
+in the configuration file and also set daemon labels via the `--label` flag.
1006 1006
 Options that are not present in the file are ignored when the daemon starts.
1007 1007
 
1008 1008
 ### Linux configuration file
1009 1009
 
1010
-The default location of the configuration file on Linux is 
1010
+The default location of the configuration file on Linux is
1011 1011
 `/etc/docker/daemon.json`. The `--config-file` flag can be used to specify a
1012
- non-default location. 
1012
+ non-default location.
1013 1013
 
1014 1014
 This is a full example of the allowed configuration options on Linux:
1015 1015
 
... ...
@@ -1024,6 +1024,7 @@ This is a full example of the allowed configuration options on Linux:
1024 1024
 	"storage-driver": "",
1025 1025
 	"storage-opts": [],
1026 1026
 	"labels": [],
1027
+	"live-restore": true,
1027 1028
 	"log-driver": "",
1028 1029
 	"log-opts": [],
1029 1030
 	"mtu": 0,
... ...
@@ -1085,7 +1086,7 @@ This is a full example of the allowed configuration options on Linux:
1085 1085
 
1086 1086
 The default location of the configuration file on Windows is
1087 1087
  `%programdata%\docker\config\daemon.json`. The `--config-file` flag can be
1088
- used to specify a non-default location. 
1088
+ used to specify a non-default location.
1089 1089
 
1090 1090
 This is a full example of the allowed configuration options on Windows:
1091 1091
 
... ...
@@ -1099,7 +1100,8 @@ This is a full example of the allowed configuration options on Windows:
1099 1099
     "storage-driver": "",
1100 1100
     "storage-opts": [],
1101 1101
     "labels": [],
1102
-    "log-driver": "", 
1102
+    "live-restore": true,
1103
+    "log-driver": "",
1103 1104
     "mtu": 0,
1104 1105
     "pidfile": "",
1105 1106
     "graph": "",
... ...
@@ -1139,6 +1141,7 @@ The list of currently supported options that can be reconfigured is this:
1139 1139
 - `cluster-store-opts`: it uses the new options to reload the discovery store.
1140 1140
 - `cluster-advertise`: it modifies the address advertised after reloading.
1141 1141
 - `labels`: it replaces the daemon labels with a new set of labels.
1142
+- `live-restore`: Enables [keeping containers alive during daemon downtime](../../admin/live-restore.md).
1142 1143
 - `max-concurrent-downloads`: it updates the max concurrent downloads for each pull.
1143 1144
 - `max-concurrent-uploads`: it updates the max concurrent uploads for each push.
1144 1145
 - `default-runtime`: it updates the runtime to be used if not is