Prometheus监控elasticsearch

来自Linux78|wiki

安装es监控插件

https://github.com/justwatchcom/elasticsearch_exporter

wget https://github.com/justwatchcom/elasticsearch_exporter/releases/download/v1.1.0/elasticsearch_exporter-1.1.0.linux-amd64.tar.gz
tar -zxvf elasticsearch_exporter-1.1.0.linux-amd64.tar.gz
cd elasticsearch_exporter-1.1.0.linux-amd64
nohup ./elasticsearch_exporter --es.uri http://10.x.xx.100:9200 &&

启动成功后,可以访问 http://ip:9109/metrics

## 参数说明:
--es.uri             默认http://localhost:9200,连接到的Elasticsearch节点的地址(主机和端口)。 这可以是本地节点(例如localhost:9200),也可以是远程 Elasticsearch服务器的地址
--es.all                默认flase,如果为true,则查询群集中所有节点的统计信息,而不仅仅是查询我们连接到的节点。
--es.cluster_settings   默认flase,如果为true,请在统计信息中查询集群设置
--es.indices            默认flase,如果为true,则查询统计信息以获取集群中的所有索引。
--es.indices_settings   默认flase,如果为true,则查询集群中所有索引的设置统计信息。
--es.shards             默认flase,如果为true,则查询集群中所有索引的统计信息,包括分片级统计信息(意味着es.indices = true)。
--es.snapshots          默认flase,如果为true,则查询集群快照的统计信息。

Prometheus配置

- job_name: "elasticsearch"
    static_configs:
      - targets: ['192.168.0.237:9114']

Grafana配置

下载仪表盘地址:https://grafana.com/grafana/dashboards/2322