This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.7.9. 使用旧的 Fluentd 方法转发日志
您可以通过创建配置文件和配置映射,使用 Fluentd forward 协议将日志发送到 OpenShift Container Platform 集群外的目的地。您需要配置外部日志聚合器,以接收来自 OpenShift Container Platform 的日志数据。
此转发日志的方法在 OpenShift Container Platform 中已弃用,并将在以后的发行版本中删除。
要使用 Fluentd forward 协议发送日志,请创建一个名为 secure-forward.conf
的配置文件,指向外部日志聚合器。然后,使用该文件在 openshift-logging 项目中创建一个名为
映射,OpenShift Container Platform 在转发日志时使用它。
secure-forward
的配置
先决条件
- 您必须有配置为使用指定协议或格式接收日志数据的日志服务器。
Fluentd 配置文件示例
流程
配置 OpenShift Container Platform 使用旧的 Fluentd 方法转发日志:
创建名为
secure-forward 的
配置文件,并在<store>
部分中指定类似如下的参数:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 要使用 Mutual TLS(mTLS)身份验证,请参阅 Fluentd 文档来获取有关客户端证书、密钥参数和其他设置的信息。
在
openshift-logging
项目中创建名为secure-forward
的配置映射:oc create configmap secure-forward --from-file=secure-forward.conf -n openshift-logging
$ oc create configmap secure-forward --from-file=secure-forward.conf -n openshift-logging
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Red Hat OpenShift Logging Operator 会重新部署 Fluentd Pod。如果 pod 没有重新部署,您可以删除 Fluentd pod 来强制重新部署。
oc delete pod --selector logging-infra=fluentd
$ oc delete pod --selector logging-infra=fluentd