1.下载elasticsearch_exporter的二进制包并解压、运行
下载二进制包并解压、运行:
$ wget https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v1.3.0/elasticsearch_exporter-1.3.0.linux-amd64.tar.gz
$ tar -xvf elasticsearch_exporter-1.3.0.linux-amd64.tar.gz
$ mv elasticsearch_exporter-1.3.0.linux-amd64/ elasticsearch_exporter
$ cd elasticsearch_exporter/
运行elasticsearch_exporter:
$ nohup ./elasticsearch_exporter --es.all --es.indices --es.cluster_settings --es.indices_settings --es.shards --es.snapshots --es.timeout=10s --web.listen-address=":9114" --web.telemetry-path="/metrics" --es.uri http://10.20.30.40:9200 &xelasticsearch_exporter
查看输出日志:
$ tailf nohup.out
看指标信息:
$ curl "http://10.20.30.40:9114/metrics"
2.在Prometheus配置文件中加入新的job_name,写elasticsearch_exporter暴露指标的ip端口:
添加job_