0

在设置 ElasticSearch Exporter 的服务时,我想出了以下内容

[Unit]
Description=Prometheus ES_exporter
After=local-fs.target network-online.target network.target
Wants=local-fs.target network-online.target network.target

[Service]
User=root
Nice=10
ExecStart = /usr/local/bin/es_exporter --es.uri=http://elastic_user:XXXXXXXXXXX@localhost:9200 --es.all --es.indices --es.timeout 20s
ExecStop= /usr/bin/killall es_exporter

[Install]
WantedBy=default.target

我不知道要输入什么值....

 http://elastic_user:XXXXXXXXXXX@localhost:9200

会不会像....?

http://elastic_user(by which I am starting peocess):(PASSWORD)@(IP/LOCALHOST):9200

[附加信息:这些更改用于使用 Prometheus 和 Grafana 监控 ElasticSearch 集群]

4

1 回答 1

0

在文档中,这是这样写的:

远程 Elasticsearch 服务器的地址。当需要基本身份验证时,指定为:://:@:。例如,http://admin:pass@localhost:9200。

这里的文档:https ://github.com/prometheus-community/elasticsearch_exporter#configuration

这里的一个例子: https ://github.com/Lyr/ansible-elasticsearch-exporter/blob/master/templates/elasticsearch_exporter.service.j2

于 2021-06-04T09:57:34.133 回答