Skip to content

Conversation

mburke5678
Copy link
Contributor

@mburke5678 mburke5678 commented Jul 19, 2019

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 19, 2019
@openshift-docs-preview-bot

The preview will be available shortly at:

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 19, 2019
@@ -41,8 +45,8 @@ If you set the `MERGE_JSON_LOG` and `CDM_UNDEFINED_TO_STRING` enviroment variabl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richm Does this problem affect Rsyslog as it affected Fluentd?
If you set the MERGE_JSON_LOGandCDM_UNDEFINED_TO_STRINGenviroment variables totrue, you might receive an Elasticsearch *400* error.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@@ -42,7 +42,7 @@ $ oc edit configmap/fluentd
The format of the *_throttle-config.yaml_* key is a YAML file that contains
project names and the desired rate at which logs are read in on each
node. The default is 1000 lines at a time per node. For example:

+
----
throttle-config.yaml: |
- opensift-logging:
Copy link
Contributor Author

@mburke5678 mburke5678 Jul 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richm Where in the config map is this code added? The console reported the CM is updated, but the code disappears.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throttling is not supported (yet) by rsyslog.

@@ -13,6 +13,9 @@ hosted Fluentd has processed them.
ifdef::openshift-origin[]
The `secure-forward` plug-in is provided with the Fluentd image as of v1.4.0.
endif::openshift-origin[]
ifdef::openshift-enterprise[]
The `secure-forward` plug-in is supported by Fluentd only.
enddef::openshift-enterprise[]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richm Is the secure-forward plug-in for Fluentd only?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We'll have to figure out some other way for rsyslog to forward logs off of the cluster.

@mburke5678
Copy link
Contributor Author

@richm This is a WIP. However, I have a few questions if you would be so kind.

@mburke5678 mburke5678 force-pushed the logging-rsyslog branch 2 times, most recently from 5f64b6a to a1de25e Compare July 25, 2019 21:46
@@ -9,6 +9,11 @@ The Event Router communicates with the {product-title} and prints {product-title

If Cluster Logging is deployed, you can view the {product-title} events in Kibana.

NOTE:
====
The Event Router is not supported for the Rsyslog log collector.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should add that to the list of differences between fluentd and rsyslog

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outdated

[cols="3,7",options="header"]
|===
|Parameter
|Description

| `LOGGING_FILE_SIZE` | The maximum size of a single Fluentd log file in Bytes. If the size of the *fluentd.log* file exceeds this value, {product-title} renames the *fluentd.log.** files and creates a new *fluentd.log*. The default is 1024000 (1MB).
| `LOGGING_FILE_AGE` | The number of logs that Fluentd retains before deleting. The default value is `10`.
| `LOGGING_FILE_SIZE` | The maximum size of a single log collector file in Bytes. If the size of the *fluentd.log* file exceeds this value, {product-title} renames the log files and creates a new file. The default is 1024000 (1MB).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size of the fluentd.log file or the rsyslog.log file

@mburke5678 mburke5678 changed the title Adding rsyslog topics back to 4.2 Rsyslog GA Aug 6, 2019
@mburke5678 mburke5678 changed the title Rsyslog GA Adding rsyslog topics back to 4.2 Aug 6, 2019
@mburke5678
Copy link
Contributor Author

mburke5678 commented Aug 8, 2019

@QiaolingTang Is this something you can review?
I reverted the current 4.1 docs to include both Rsyslog and Fluentd.

  • Changed Fluentd to log collector or Fluentd or Rsyslog as appropriate.
  • Added examples for Rsyslog as approptiate.
  • Made a few other file names more generic.
  • Other required changes.

The might be some issues that are being followed in other PRs that apply to these files. I just want to make sure the files here look good.

configuration of the log collector, Fluentd or Rsyslog.

See the link:https://github.com/openshift/origin-aggregated-logging/blob/master/fluentd/README.md[Fluentd README] in Github or the
link:https://github.com/openshift/origin-aggregated-logging/blob/master/rsyslog/README.md[Rsyslog README] for lists of the
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


* logStore - This is where the logs will be stored. The current implementation is Elasticsearch.
* collection - This is the component that collects logs from the node, formats them, and stores them in the logStore. The current implementation is Fluentd.
* collection - This is the component that collects logs from the node, formats them, and stores them in the logStore. The current implementation is Fluentd, default, or Rsyslog.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we don't have an default option here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QiaolingTang Thank you. I will correct this throughout. There is no default. The user needs to specify the collector in the CR.

* *RSYSLOG_IMAGE* deploys Rsyslog, by default `docker.io/viaq/rsyslog:latest`. <1>

<1> The image used for RSYSLOG when deployed. You can change this value using an environment variable. You cannot change this value through the Cluster Logging CR.
<6> *RSYSLOG_IMAGE* deploys Rsyslog, by default `docker.io/viaq/rsyslog:latest`. You can change this value using an environment variable. You cannot change this value through the Cluster Logging CR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the default value of RSYSLOG_IMAGE will be docker.io/viaq/rsyslog:latest after the rsyslog's GA. And the RSYSLOG_IMAGE is written in the CSV, it's better not to change the value. Setting environment variable won't make any change.

requests:
cpu: 250m
memory: 1Gi
----
Copy link

@QiaolingTang QiaolingTang Aug 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mburke5678 I checked the default values of rsyslog's resources, they are:

name: rsyslog
resources:
  limits:
    memory: 358Mi
  requests:
    cpu: 100m
    memory: 358Mi

name: logrotate
resources:
  limits:
    memory: 358Mi
  requests:
    cpu: 100m
    memory: 358Mi

@@ -39,3 +39,27 @@ spec:
memory: 1Gi
----
<1> Specify the CPU and memory limits as needed. The values shown are the default values.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users can specify the limits and requests.


Fluentd writes logs to a specified file or to the default location, `/var/log/fluentd/fluentd.log`,
The log collector, Fluentd or Rsyslog, writes logs to a specified file or to the default location, `/var/log/fluentd/fluentd.log`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For fluentd, it's /var/log/fluentd/fluentd.log , for rsyslog, it is /var/log/rsyslog/rsyslog.log

rsyslog.log.2 1Mb
rsyslog.log.3 1Mb
rsyslog.log.4 1Mb
----

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log files for rsyslog is looks like:
-rw-r--r--. 1 root root 467 Jul 17 03:40 logrotate.log
-rw-r--r--. 1 root root 1007 Jul 17 03:25 rsyslog.log
-rw-r--r--. 1 root root 10382396 Jul 17 02:49 rsyslog.log-20190717-1563331501
-rw-r--r--. 1 root root 12649621 Jul 17 03:02 rsyslog.log-20190717-1563332101
-rw-r--r--. 1 root root 11345789 Jul 17 03:11 rsyslog.log-20190717-1563332701
-rw-r--r--. 1 root root 12271294 Jul 17 03:21 rsyslog.log-20190717-1563333302
-rw-r--r--. 1 root root 23122678 Jul 17 03:40 rsyslog.log-20190717-1563333901

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I forgot that I wanted an overly-simple example without the full naming to show the rotation. I'm not sure the fluentd log file names I have are accurate for what the user will see.
Do you think this will work to show the rotation, or would using real log file names make more sense?

The following example shows logs in a cluster where the maximum log size is 1Mb and four logs should be retained. When the `log`reaches 1Mb, {product-title}
deletes the current `log.4`, renames the each of the Fluentd logs in turn, and creates a new `log`.

----
log     0b
log.1  1Mb
log.2  1Mb
log.3  1Mb
log.4  1Mb
----

[cols="3,7",options="header"]
|===
|Parameter
|Description

| `LOGGING_FILE_SIZE` | The maximum size of a single Fluentd log file in Bytes. If the size of the *fluentd.log* file exceeds this value, {product-title} renames the *fluentd.log.** files and creates a new *fluentd.log*. The default is 1024000 (1MB).
| `LOGGING_FILE_AGE` | The number of logs that Fluentd retains before deleting. The default value is `10`.
| `LOGGING_FILE_SIZE` | The maximum size of of the fluentd.log file or the rsyslog.log file in Bytes. If the size of the *fluentd.log* file exceeds this value, {product-title} renames the log files and creates a new file. The default is 1024000 (1MB).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log rotation of rsyslog is different from fluentd. There has a configmap logrotate-crontab controlls the rsyslog's log rotation. You can get some information from: https://bugzilla.redhat.com/show_bug.cgi?id=1730211#c1

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is a configmap with a crontab, and one with the logrotate config, but the user doesn't need to use those. Most users will be able to set these environment variables and not need to know the implementation details. I suppose we should document those configmaps, but we should tell users that they probably don't need to touch them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QiaolingTang @nhosoi In order to change the log rotation parameters, does the user still edit the rsyslog daemonset or edit the logrotate configmap?

oc set env daemonset/rsyslog LOGGING_FILE_AGE=30 LOGGING_FILE_SIZE=1024000

oc set env cm/logrotate LOGGING_FILE_AGE=30 LOGGING_FILE_SIZE=1024000

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one:

oc set env daemonset/rsyslog LOGGING_FILE_AGE=30 LOGGING_FILE_SIZE=1024000

If an advanced user needs to change the cron or logrotate settings, they would do

oc edit configmap logrotate-bin
or
oc edit configmap logrotate-crontab

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richm Thanks. I didn't see your comment above as I didn't refresh the page.

@mburke5678 mburke5678 force-pushed the logging-rsyslog branch 2 times, most recently from ffc97de to 336f5cc Compare August 23, 2019 16:11
@mburke5678
Copy link
Contributor Author

@QiaolingTang Are you satisfied with this PR?

KIBANA_IMAGE=registry.redhat.io/openshift4/ose-logging-kibana5:v4.2 <3>
CURATOR_IMAGE=registry.redhat.io/openshift4/ose-logging-curator5:v4.2 <4>
OAUTH_PROXY_IMAGE=registry.redhat.io/openshift4/ose-oauth-proxy:v4.2 <5>
RSYSLOG_IMAGE=quay.io/openshift/origin-logging-rsyslog:latest <6>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the rsyslog image would be something like registry.redhat.io/openshift4/ose-logging-rsyslog:v4.2 when the 4.2 GA.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. In 4.2, rsyslog is in the redhat registry like everything else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QiaolingTang Thank you. RSYSLOG_IMAGE=quay.io/openshift/origin-logging-rsyslog:latest is what appears in 4.1. I must have gotten this string from 4.1. Fixed!


How you view logs depends upon the `LOGGING_FILE_PATH` setting.
How you view logs collected by the log collector, Fluentd or Rsyslog, depends upon the `LOGGING_FILE_PATH` setting.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These logs are not collected by the log collector, they are generated by the log collector.

@mburke5678 mburke5678 merged commit 314185f into openshift:master Aug 28, 2019
@mburke5678 mburke5678 deleted the logging-rsyslog branch August 28, 2019 19:11
@mburke5678
Copy link
Contributor Author

/cherrypick enterprise-4.2

@openshift-cherrypick-robot

@mburke5678: new pull request created: #16419

In response to this:

/cherrypick enterprise-4.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mburke5678
Copy link
Contributor Author

Moving to 4.3. Reverting changes added to 4.2 

#16597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants