Automation Suite
2023.10
False
横幅背景图像
Linux 版 Automation Suite 安装指南
上次更新日期 2024年4月19日

设置 Elasticsearch 和 Kibana

EFK(Elasticsearch、Fluentd、Kibana)堆栈是一个集中式日志记录解决方案,可用于搜索、分析和可视化日志数据。Fluentd 收集日志并将其发送到 Elasticsearch,Kibana 检索日志并让您可视化和分析数据。

Automation Suite 支持 Elasticsearch 版本 7.x。同样支持 8.x 版,但仅适用于高级配置。

使用 Elasticsearch 密码创建密码

如果您的 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 配置:

  • <elasticsearch host> - Elasticsearch 实例的网络主机;
  • <elasticsearch port> - 用于客户端通信的 Elasticsearch 端口;
  • <secret key> - 包含 Elasticsearch 密码的密码;
  • elasticsearch.buffer 中的 timekey 值 - 输出频率,即您想要推送日志的频率;
  • elasticsearch.scheme - URL 方案。有效值为:httphttps
    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
    EOFkubectl -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

FluentD 中的集群流程

在 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:
          app: csi-resizer
    - select: {}
EOFkubectl -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:
          app: csi-resizer
    - select: {}
EOF
系统会收集集群中的日志并将其记录到 ClusterOutput 中。

配置 Kibana

  1. 单击侧边栏中“分析”下的“发现”。


  2. 单击“创建索引模式”,然后单击“创建名为 Fluentd 的索引模式”。


  3. 在“配置设置”窗口中选择“我不想使用时间筛选器”。


  4. 单击侧边栏中“Kibana”下的“发现”。


    • 您可以在仪表板中查看日志。


    • 记录对 UiPath 命名空间和特定服务的查询:


此页面是否有帮助?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath 白色徽标
信任与安全
© 2005-2024 UiPath. All rights reserved.