Skip to content

Commit 618155f

Browse files
authored
Merge pull request #7191 from mburke5678/BZ-1526262
Clarified support for journald per BZ
2 parents 33265c6 + 0f7c261 commit 618155f

File tree

3 files changed

+75
-17
lines changed

3 files changed

+75
-17
lines changed

install_config/aggregate_logging.adoc

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,23 @@ administrators can view all logs, but application developers can only view logs
4242
for projects they have permission to view. The stack components communicate
4343
securely.
4444

45-
[NOTE]
46-
====
47-
xref:../install_config/install/host_preparation.adoc#managing-docker-container-logs[Managing
48-
Docker Container Logs] discusses the use of `json-file` logging driver options
45+
Aggregated logging is supported using the `json-file` or `journald` driver in Docker.
46+
The Docker log driver is set to `journald` as the default for all nodes. See
47+
xref:fluentd-upgrade-source[Updating Fluentd's Log Source After a Docker Log
48+
Driver Update] for more information about switching between `json-file` and `journald`.
49+
Fluentd automatically determines which log driver (`journald` or `json-file`) the container runtime is using.
50+
51+
When the log driver is set to `journald`, Fluentd reads journald logs. When set to `json-file` Fluentd reads from *_/var/log/containers_*.
52+
53+
See xref:../install_config/install/host_preparation.adoc#managing-docker-container-logs[Managing
54+
Docker Container Logs] for information on `json-file` logging driver options
4955
to manage container logs and prevent filling node disks.
5056

51-
Aggregated logging is only supported using the `journald` driver in Docker. See
52-
xref:fluentd-upgrade-source[Updating Fluentd's Log Source After a Docker Log
53-
Driver Update] for more information.
57+
58+
[IMPORTANT]
59+
====
60+
If Docker log-driver is set to journald, there is no log rate throttling with the `journald` driver.
61+
As a result, there is a risk of denial-of-service attacks from rogue containers.
5462
====
5563

5664
[[aggregate-logging-pre-deployment-configuration]]
@@ -1764,6 +1772,57 @@ $ curl --key /etc/elasticsearch/secret/admin-key \
17641772
----
17651773
====
17661774

1775+
[[fluentd-update-source]]
1776+
== Changing the Aggregated Logging Driver
1777+
1778+
By default, aggregated logging uses the `journald` log driver
1779+
xref:../install_config/install/advanced_install.adoc#configuring-host-variables[unless `json-file` was specified during installation]. You can change the log driver between `journald` and `json-file` as needed.
1780+
1781+
[IMPORTANT]
1782+
====
1783+
When using the `json-file` driver, ensure that your Docker version is Docker version *docker-1.12.6-55.gitc4618fb.el7_4 now*
1784+
or later.
1785+
====
1786+
1787+
Fluentd determines the driver Docker is using by checking the *_/etc/docker/daemon.json_* and *_/etc/sysconfig/docker_* files.
1788+
1789+
You can determine which driver Docker is using with the `docker info` command:
1790+
1791+
----
1792+
# docker info | grep Logging
1793+
1794+
Logging Driver: journald
1795+
----
1796+
1797+
To change between `json-file` and `journald` after installation:
1798+
1799+
. Modify either the *_/etc/sysconfig/docker_* or *_/etc/docker/daemon.json_* files.
1800+
+
1801+
For example:
1802+
+
1803+
[source,json]
1804+
----
1805+
# cat /etc/sysconfig/docker
1806+
OPTIONS=' --selinux-enabled --log-driver=json-file --log-opt max-size=1M --log-opt max-file=3 --signature-verification=False'
1807+
1808+
cat /etc/docker/daemon.json
1809+
{
1810+
"log-driver": "json-file",
1811+
"log-opts": {
1812+
"max-size": "1M",
1813+
"max-file": "1"
1814+
}
1815+
}
1816+
----
1817+
1818+
. Restart the Docker service:
1819+
+
1820+
----
1821+
systemctl restart docker
1822+
----
1823+
1824+
. Update the xref:fluentd-upgrade-source[Fluentd log source].
1825+
17671826
[[fluentd-upgrade-source]]
17681827
== Updating Fluentd's Log Source After a Docker Log Driver Update
17691828

install_config/install/advanced_install.adoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,16 @@ which may cause invalid configurations. Example usage:
511511
*{'image-gc-high-threshold': ['90'],'image-gc-low-threshold': ['80']}*.
512512

513513
|`openshift_docker_options`
514-
|This variable configures additional `docker` options within
514+
a|This variable configures additional `docker` options within
515515
*_/etc/sysconfig/docker_*, such as options used in
516-
xref:../../install_config/install/host_preparation.adoc#managing-docker-container-logs[Managing Container Logs]. Example usage: *"--log-driver json-file --log-opt max-size=1M
517-
--log-opt max-file=3"*. Do not use when
516+
xref:../../install_config/install/host_preparation.adoc#managing-docker-container-logs[Managing Container Logs].
517+
Use `json-file` or `journald`. The default is `journald`.
518+
Example usage:
519+
----
520+
"--log-driver json-file --log-opt max-size=1M --log-opt max-file=3"
521+
"--log-driver journald"
522+
----
523+
Do not use when
518524
xref:advanced-install-docker-system-container[running `docker` as a system container].
519525

520526
|`openshift_schedulable`

install_config/install/host_preparation.adoc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,6 @@ container is running) can increase to a problematic size. You can manage this by
579579
configuring Docker's `json-file` logging driver to restrict the size and number
580580
of log files.
581581

582-
[IMPORTANT]
583-
====
584-
Aggregated logging is only supported using the `journald` driver in Docker. See
585-
xref:../../install_config/aggregate_logging.adoc#fluentd-upgrade-source[Updating
586-
Fluentd's Log Source After a Docker Log Driver Update] for more information.
587-
====
588-
589582
[options="header"]
590583
|===
591584

0 commit comments

Comments
 (0)