automation-suite
2023.4
false
- 概述
- 要求
- 安装
- 安装后
- 集群管理
- 监控和警示
- 迁移和升级
- 特定于产品的配置
- 最佳实践和维护
- 故障排除
设置 Elasticsearch 和 Kibana
重要 :
请注意此内容已使用机器翻译进行了部分本地化。
Linux 版 Automation Suite 安装指南
Last updated 2024年9月5日
设置 Elasticsearch 和 Kibana
EFK(Elasticsearch、Fluentd、Kibana)堆栈是一个集中式日志记录解决方案,可用于搜索、分析和可视化日志数据。Fluentd 收集日志并将其发送到 Elasticsearch,Kibana 检索日志并让您可视化和分析数据。
Automation Suite 支持 Elasticsearch 版本 7.x。同样支持 8.x 版,但仅适用于高级配置。
如果您的 Elasticsearch 实例需要凭据,请在集群中使用其密码创建一个密码。
kubectl -n cattle-logging-system create secret generic elastic-user --from-literal=password=<password>
kubectl -n cattle-logging-system create secret generic elastic-user --from-literal=password=<password>
运行以下命令,将集群输出到 Elasticsearch。将以下属性替换为您的 Elasticsearch 配置:
<elasticsearch host>
- Elasticsearch 实例的网络主机;<elasticsearch port>
- 用于客户端通信的 Elasticsearch 端口;<secret key>
- 包含 Elasticsearch 密码的密码;elasticsearch.buffer
中的timekey
值 - 输出频率,即您想要推送日志的频率;-
elasticsearch.scheme
- URL 方案。有效值为:http
或https
。kubectl -n cattle-logging-system apply -f - <<"EOF" apiVersion: logging.banzaicloud.io/v1beta1 kind: ClusterOutput metadata: name: es-output spec: elasticsearch: host: <elasticsearch host> port: <elasticsearch port> scheme: <http or https> ssl_verify: false ssl_version: TLSv1_2 user: elastic password: valueFrom: secretKeyRef: name: elastic-user key: <secret key> buffer: timekey: 10m timekey_wait: 30s timekey_use_utc: true EOF
kubectl -n cattle-logging-system apply -f - <<"EOF" apiVersion: logging.banzaicloud.io/v1beta1 kind: ClusterOutput metadata: name: es-output spec: elasticsearch: host: <elasticsearch host> port: <elasticsearch port> scheme: <http or https> ssl_verify: false ssl_version: TLSv1_2 user: elastic password: valueFrom: secretKeyRef: name: elastic-user key: <secret key> buffer: timekey: 10m timekey_wait: 30s timekey_use_utc: true EOF
在 FluendD 中对集群流程运行以下命令:
kubectl -n cattle-logging-system apply -f - <<"EOF"
apiVersion: logging.banzaicloud.io/v1beta1
kind: ClusterFlow
metadata:
name: es-flow
spec:
filters:
- tag_normaliser:
format: ${namespace_name}/${pod_name}.${container_name}
globalOutputRefs:
- es-output
match:
- select:
container_names:
- istio-proxy
namespaces:
- istio-system
- exclude:
container_names:
- istio-proxy
- istio-init
- aicenter-hit-count-update
- exclude:
namespaces:
- fleet-system
- cattle-gatekeeper-system
- default
- exclude:
labels:
app: csi-snapshotter
- exclude:
labels:
longhorn.io/job-task: backup
- exclude:
labels:
app: csi-resizer
- select: {}
EOF
kubectl -n cattle-logging-system apply -f - <<"EOF"
apiVersion: logging.banzaicloud.io/v1beta1
kind: ClusterFlow
metadata:
name: es-flow
spec:
filters:
- tag_normaliser:
format: ${namespace_name}/${pod_name}.${container_name}
globalOutputRefs:
- es-output
match:
- select:
container_names:
- istio-proxy
namespaces:
- istio-system
- exclude:
container_names:
- istio-proxy
- istio-init
- aicenter-hit-count-update
- exclude:
namespaces:
- fleet-system
- cattle-gatekeeper-system
- default
- exclude:
labels:
app: csi-snapshotter
- exclude:
labels:
longhorn.io/job-task: backup
- exclude:
labels:
app: csi-resizer
- select: {}
EOF
系统会收集集群中的日志并将其记录到
ClusterOutput
中。