首页 > 解决方案 > 使用 Metricbeat Keystore 但它不起作用(Metricbeat v6.6.0)?

问题描述

我正在尝试在我的 metricbeatbeat 配置中使用密钥库值,但我似乎无法让它工作......

我创建了 initContainer,因为我只是在创建密钥库并在 ES_PWD 中添加我的弹性搜索密码!

metricbeat --path.config=/usr/share/metricbeat/keystore -c /etc/metricbeat.yml keystore create
echo 'my-ES-clear-text-pwd' | metricbeat --path.config=/usr/share/metricbeat/keystore -c /etc/metricbeat.yml keystore add ES_PWD --stdin --force 
metricbeat --path.config=/usr/share/metricbeat/keystore -c /etc/metricbeat.yml keystore list

[在 initContainer 和实际容器之间共享卷!]

在实际的 metricbeat 容器中尝试运行 metricbeat 服务但它没有启动。(./metricbeat --path.config=/usr/share/metricbeat/keystore -c /etc/metricbeat.yml -e)

但是 pod 正在运行,但 metricbeat 服务没有在其中启动!

如果我执行到 pod 并手动复制 metricbeat.keystore 并且如果我尝试手动运行 metricbeat 服务,那么它正在运行。

我发现了一个类似的问题:https ://discuss.elastic.co/t/using-keystores-not-working-v6-6-0/167301

但是,我无法每次都手动执行此操作,因为我的 metricbeat pod 部署为 daemonset 并部署在我的 K8s 集群中。

提前致谢。

标签: elasticsearchkuberneteskeystoremetricbeatelastic-beats

解决方案


推荐阅读