- 概述
- 要求
- 安装
- 安装后
- 集群管理
- 监控和警示
- 迁移和升级
- 特定于产品的配置
- 最佳实践和维护
- 故障排除
- 无法获取沙盒映像
- Pod 未显示在 ArgoCD 用户界面中
- Redis 探测器失败
- RKE2 服务器无法启动
- 在 UiPath 命名空间中找不到密码
- 初始安装后,ArgoCD 应用程序进入“进行中”状态
- MongoDB Pod 处于 CrashLoopBackOff 状态或在删除后处于“等待 PVC 配置”状态
- 意外错误:不一致;手动运行 fsck
- 集群还原后 MongoDB 或业务应用程序降级
- 缺少 Self-heal-operator 和 Sf-k8-utils 存储库
- 集群还原或回滚后服务不正常
- RabbitMQ Pod 卡在 CrashLoopBackOff 中
- Prometheus 处于 CrashLoopBackoff 状态,并出现内存不足 (OOM) 错误
- 监控仪表板中缺少 Ceph-rook 指标
- Pod 无法在代理环境中与 FQDN 通信
- 使用 Automation Suite 诊断工具
- 使用 Automation Suite 支持捆绑包
- 探索日志
设置 Splunk
- This section covers exporting POD logs. For exporting robot logs, see Ochestrator - About Logs.
- Splunk is an external tool, and UiPath does not have an opinion on how you should configure your Splunk setting. For more details about HTTP Event Collector, see Splunk official documentation.
Splunk-Fluentd 堆栈是一个集中式日志记录解决方案,可用于搜索、分析和可视化日志数据。Fluentd 收集日志并将其发送到 Splunk。Splunk 会检索日志,并让您可视化和分析数据。
使用令牌创建密码
要使用 Splunk 的 HTTP 事件收集器令牌在集群中创建密码,请运行以下命令:
kubectl -n cattle-logging-system create secret generic splunk-hec-token --from-literal=splunk_hec_token=<splunk_hec_token>
kubectl -n cattle-logging-system create secret generic splunk-hec-token --from-literal=splunk_hec_token=<splunk_hec_token>
集群输出到 Splunk
Run the following command to ClusterOutput to Splunk. Replace the following attributes with the ones used in your Splunk configuration:
kubectl -n cattle-logging-system apply -f - <<"EOF"
apiVersion: logging.banzaicloud.io/v1beta1
kind: ClusterOutput
metadata:
name: splunk-output
spec:
splunkHec:
buffer:
tags: '[]'
timekey: <splunk_hec_timekey>
timekey_use_utc: true
timekey_wait: 10s
type: file
hec_host: <splunk_hec_host>
hec_port: <splunk_hec_port>
hec_token:
valueFrom:
secretKeyRef:
key: <secret_key>
name: splunk-hec-token
index: <splunk_hec_index>
insecure_ssl: true
protocol: <splunk_hec_protocol>
source: <splunk_hec_source>
sourcetype: <splunk_hec_source_type>
EOF
kubectl -n cattle-logging-system apply -f - <<"EOF"
apiVersion: logging.banzaicloud.io/v1beta1
kind: ClusterOutput
metadata:
name: splunk-output
spec:
splunkHec:
buffer:
tags: '[]'
timekey: <splunk_hec_timekey>
timekey_use_utc: true
timekey_wait: 10s
type: file
hec_host: <splunk_hec_host>
hec_port: <splunk_hec_port>
hec_token:
valueFrom:
secretKeyRef:
key: <secret_key>
name: splunk-hec-token
index: <splunk_hec_index>
insecure_ssl: true
protocol: <splunk_hec_protocol>
source: <splunk_hec_source>
sourcetype: <splunk_hec_source_type>
EOF
| 属性 | 描述 |
|---|---|
splunk_hec_host | Splunk 实例的网络主机。 |
splunk_hec_port | 用于客户端通信的 Splunk 端口。 |
secret_key | 带有 Splunk 令牌的密钥。 |
splunk_hec_timekey 中的值 splunkHec.buffer | 输出频率,即您想要推送日志的频率。 |
protocol | URL 协议。有效值为 http 和 https。 |
splunk_hec_index | 用于索引事件的 Splunk 索引标识符。 |
splunk_hec_source | 事件的来源字段。 |
splunk_hec_source_type | 事件的来源类型字段。 |
FluentD 中的集群流程
Run the following command to ClusterFlow in Fluentd:
kubectl -n cattle-logging-system apply -f - <<"EOF"
apiVersion: logging.banzaicloud.io/v1beta1
kind: ClusterFlow
metadata:
name: splunk-flow
namespace: cattle-logging-system
spec:
filters:
- tag_normaliser:
format: ${namespace_name}/${pod_name}.${container_name}
globalOutputRefs:
- splunk-output
match:
- select:
container_names:
- istio-proxy
namespaces:
- istio-system
- exclude:
container_names:
- istio-proxy
- istio-init
- aicenter-hit-count-update
- istio-configure-executor
- on-prem-tenant-license-update
- curl
- recovery
- aicenter-oob-scheduler
- cert-trustor
- 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: splunk-flow
namespace: cattle-logging-system
spec:
filters:
- tag_normaliser:
format: ${namespace_name}/${pod_name}.${container_name}
globalOutputRefs:
- splunk-output
match:
- select:
container_names:
- istio-proxy
namespaces:
- istio-system
- exclude:
container_names:
- istio-proxy
- istio-init
- aicenter-hit-count-update
- istio-configure-executor
- on-prem-tenant-license-update
- curl
- recovery
- aicenter-oob-scheduler
- cert-trustor
- 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 中。
配置 Splunk
要配置 Splunk,请执行以下步骤:
-
单击顶部导航栏中的“设置”,然后选择“索引”。
-
单击“新建索引”,然后单击“创建索引”。
-
单击顶部导航栏中的“设置”,然后选择“数据输入”。
-
单击“HTTP 事件收集器”。
-
单击“全局设置”以准许创建新令牌。
-
启用并保存“全局设置”。
-
单击“新建令牌”以创建令牌。
-
输入 HTTP 事件收集器的名称,然后单击“下一步”。
-
单击“新建”并输入“来源类型”详细信息。
-
向下滚动并从可用索引列表中选择“索引”,然后单击顶部导航栏中的“下一步” 。
-
验证数据,然后单击“提交”。
-
Once created, fetch the details of Token ID,Index,Source,Source Type. You will need these when setting up ClusterOutput.
在 Splunk 中搜索
-
单击“搜索和报告”。
-
Search based on Source,Index, and SourceType.
故障排除
如果由于某种原因应用程序日志未推送到 Splunk,请尝试以下操作:
-
将 Fluentd 日志级别更改为调试
-
查询 Fluentd Pod:
kubectl patch loggings.logging.banzaicloud.io rancher-logging-root --type=json -p '[{"op":"add","path":"/spec/fluentd/logLevel","value":debug}]' kubectl -n cattle-logging-system exec -it sts/rancher-logging-root-fluentd cat /fluentd/log/outkubectl patch loggings.logging.banzaicloud.io rancher-logging-root --type=json -p '[{"op":"add","path":"/spec/fluentd/logLevel","value":debug}]' kubectl -n cattle-logging-system exec -it sts/rancher-logging-root-fluentd cat /fluentd/log/out备注:Fluentd 日志应指明数据未推送到 Splunk 的原因。
-
修复问题后,还原 FluentD 日志级别:
kubectl patch loggings.logging.banzaicloud.io rancher-logging-root --type=json -p '[{"op":"remove","path":"/spec/fluentd/logLevel"}]'kubectl patch loggings.logging.banzaicloud.io rancher-logging-root --type=json -p '[{"op":"remove","path":"/spec/fluentd/logLevel"}]'