Skip to content

[enterprise-3.7] Clarified support for journald per BZ #7923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 66 additions & 7 deletions install_config/aggregate_logging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,23 @@ administrators can view all logs, but application developers can only view logs
for projects they have permission to view. The stack components communicate
securely.

[NOTE]
====
xref:../install_config/install/host_preparation.adoc#managing-docker-container-logs[Managing
Docker Container Logs] discusses the use of `json-file` logging driver options
Aggregated logging is supported using the `json-file` or `journald` driver in Docker.
The Docker log driver is set to `journald` as the default for all nodes. See
xref:fluentd-upgrade-source[Updating Fluentd's Log Source After a Docker Log
Driver Update] for more information about switching between `json-file` and `journald`.
Fluentd automatically determines which log driver (`journald` or `json-file`) the container runtime is using.

When the log driver is set to `journald`, Fluentd reads journald logs. When set to `json-file` Fluentd reads from *_/var/log/containers_*.

See xref:../install_config/install/host_preparation.adoc#managing-docker-container-logs[Managing
Docker Container Logs] for information on `json-file` logging driver options
to manage container logs and prevent filling node disks.

Aggregated logging is only supported using the `journald` driver in Docker. See
xref:fluentd-upgrade-source[Updating Fluentd's Log Source After a Docker Log
Driver Update] for more information.

[IMPORTANT]
====
If Docker log-driver is set to journald, there is no log rate throttling with the `journald` driver.
As a result, there is a risk of denial-of-service attacks from rogue containers.
====

[[aggregate-logging-pre-deployment-configuration]]
Expand Down Expand Up @@ -1762,6 +1770,57 @@ $ curl --key /etc/elasticsearch/secret/admin-key \
----
====

[[fluentd-update-source]]
== Changing the Aggregated Logging Driver

By default, aggregated logging uses the `journald` log driver
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.

[IMPORTANT]
====
When using the `json-file` driver, ensure that your Docker version is Docker version *docker-1.12.6-55.gitc4618fb.el7_4 now*
or later.
====

Fluentd determines the driver Docker is using by checking the *_/etc/docker/daemon.json_* and *_/etc/sysconfig/docker_* files.

You can determine which driver Docker is using with the `docker info` command:

----
# docker info | grep Logging

Logging Driver: journald
----

To change between `json-file` and `journald` after installation:

. Modify either the *_/etc/sysconfig/docker_* or *_/etc/docker/daemon.json_* files.
+
For example:
+
[source,json]
----
# cat /etc/sysconfig/docker
OPTIONS=' --selinux-enabled --log-driver=json-file --log-opt max-size=1M --log-opt max-file=3 --signature-verification=False'

cat /etc/docker/daemon.json
{
"log-driver": "json-file",
"log-opts": {
"max-size": "1M",
"max-file": "1"
}
}
----

. Restart the Docker service:
+
----
systemctl restart docker
----

. Update the xref:fluentd-upgrade-source[Fluentd log source].

[[fluentd-upgrade-source]]
== Updating Fluentd's Log Source After a Docker Log Driver Update

Expand Down
12 changes: 9 additions & 3 deletions install_config/install/advanced_install.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,16 @@ which may cause invalid configurations. Example usage:
*{'image-gc-high-threshold': ['90'],'image-gc-low-threshold': ['80']}*.

|`openshift_docker_options`
|This variable configures additional `docker` options within
a|This variable configures additional `docker` options within
*_/etc/sysconfig/docker_*, such as options used in
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
--log-opt max-file=3"*. Do not use when
xref:../../install_config/install/host_preparation.adoc#managing-docker-container-logs[Managing Container Logs].
Use `json-file` or `journald`. The default is `journald`.
Example usage:
----
"--log-driver json-file --log-opt max-size=1M --log-opt max-file=3"
"--log-driver journald"
----
Do not use when
xref:advanced-install-docker-system-container[running `docker` as a system container].

|`openshift_schedulable`
Expand Down
7 changes: 0 additions & 7 deletions install_config/install/host_preparation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -579,13 +579,6 @@ container is running) can increase to a problematic size. You can manage this by
configuring Docker's `json-file` logging driver to restrict the size and number
of log files.

[IMPORTANT]
====
Aggregated logging is only supported using the `journald` driver in Docker. See
xref:../../install_config/aggregate_logging.adoc#fluentd-upgrade-source[Updating
Fluentd's Log Source After a Docker Log Driver Update] for more information.
====

[options="header"]
|===

Expand Down