Prometheus监控elasticsearch集群(以elasticsearch-6.4.2版本为例)

部署elasticsearch集群,配置文件可“浓缩”为以下:

cluster.name: es_cluster
node.name: node1

path.data: /app/data/elasticsearch
path.logs: /app/logs/elasticsearch

network.host: 192.168.x.x
http.port: 9200
transport.tcp.port: 9201
discovery.zen.ping.unicast.hosts: ["node1", "node2","node3"]
discovery.zen.minimum_master_nodes: 2
gateway.recover_after_nodes: 3
gateway.expected_nodes: 3
gateway.recover_after_time: 5m
http.cors.enabled: true
http.cors.allow-origin: "*"
thread_pool.bulk.queue_size: 500
xpack.security.enabled: false

下载插件进行并进行安装

插件下载地址: https://github.com/vvanholl/elasticsearch-prometheus-exporter/releases

安装: 如果有elk单独用户,切换到该用户下, wget下载,进入到es安装目录,执行 ./elasticsearch-plugin install file://$(pwd)/../../elasticsearch-prometheus-exporter-6.4.2.0.zip 即可完成安装

配置Prometheus, 添加如下配置,并重新启动Prometheus

- job_name: 'elasticsearch'
    scrape_interval: 30s
    metrics_path: "/_prometheus/metrics"
    static_configs:
    - targets:
      - 192.168.x.x:9200
      - 192.168.x.x:9200
      - 192.168.x.x:9200

配置Grafana, 导入模板,编号建议为 266 (https://grafana.com/dashboards/266) 选择数据源为 Prometheus , 添加即可,会出现如下的监控图

转载于:https://www.cnblogs.com/tchroot/p/10676362.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值