Exporters | 安装elasticsearch_exporter

文章目录

一、下载linux版本的elasticsearch_exporter

下载地址:https://github.com/prometheus-community/elasticsearch_exporter

Shell 复制代码
wget https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v1.5.0/elasticsearch_exporter-1.5.0.linux-amd64.tar.gz

二、解压安装包

Shell 复制代码
tar -zxf elasticsearch_exporter-1.5.0.linux-amd64.tar.gz -C /data
mv /data/elasticsearch_exporter-* /data/elasticsearch_exporter
chown -R root.root /data/elasticsearch_exporter

三、创建启动服务文件

Shell 复制代码
vim /usr/lib/systemd/system/elasticsearch_exporter.service
[Unit]
Description=Elasticsearch Exporter
Wants=network-online.target
After=network-online.target


[Service]
User=root
Group=root
Type=simple
ExecStart=/data/es_exporter/elasticsearch_exporter \
          --es.all \
          --es.aliases \
          --es.cluster_settings \
          --es.indices \
          --es.indices_settings \
          --es.shards \
          --es.snapshots \
          --web.listen-address ":9114" \
          --es.ssl-skip-verify \
          --es.uri http://rio:ee012e12340a177f60766d35baa81955d@192.158.134.3:9200 \
          --es.timeout 20s \
          --es.clusterinfo.interval 5m
Restart=on-failure


[Install]
WantedBy=multi-user.target

四、启动服务

Shell 复制代码
systemctl daemon-reload
systemctl enable --now elasticsearch_exporter
systemctl status elasticsearch_exporter

五、查看端口和服务

ss -nltp|grep 9114

六、prometheus-server配置

prometheus.yml配置

Shell 复制代码
scrape_configs:
  - job_name: 'elasticsearch-exporter'
    file_sd_configs:
    - files:
      - targets/elasticsearch*.yaml
      refresh_interval: 2m
    relabel_configs:
      - source_labels: [ '__address__' ]
        target_label: 'instance'
        regex: "(.*):.*"
        replacement: $1

elasticsearch_exporter.yaml

Shell 复制代码
[root@test targets]# cat elasticsearch_exporter.yaml
- targets:
  - 192.158.134.8:9114
  - 192.158.134.9:9114
  - 192.158.134.11:9114
  labels:
    app: "elasticsearch-server"
    job: "elasticsearch-server"

七、动态重启配置文件

Shell 复制代码
kill -HUP `pgrep prometheus`
相关推荐
Capricorn19887 小时前
防编造架构实战:对比 Gemini Notebook 解析知芽 Notebook Skill 的工程实现
人工智能·笔记·elasticsearch·架构·知识图谱·论文笔记
玉&心7 小时前
在Kibana查看Elasticsearch中的日志或存储的文档数据
elasticsearch·kibana
liuyicenysabel8 小时前
Grafana + Prometheus 分级告警配置设计(P0/P1/P2)
javascript·grafana·prometheus
随遇而安zx8 小时前
SpringCloud---可观测性与监控:Actuator / Micrometer / Prometheus / Grafana 深度解析
spring cloud·grafana·prometheus
qq_4523962310 小时前
第四篇:《Prometheus 深度实战:指标设计、Exporter 开发与服务发现》
服务发现·prometheus
刘某的Cloud11 小时前
k8s部署prometheus架构规则
linux·运维·kubernetes·prometheus·监控
Elastic 中国社区官方博客11 小时前
安装 Elasticsearch
大数据·数据库·elasticsearch·搜索引擎·全文检索
LlmCraft|大模型工程实践13 小时前
12. Docker 日志管理与监控:ELK 日志收集 + Prometheus 性能监控
elk·docker·prometheus
DevOps老兵1 天前
AI Infra实战02:GPU监控实战,用DCGM+Prometheus+Grafana看清每一张卡
人工智能·grafana·prometheus·ai infra·gpu监控·dcgm
heimeiyingwang1 天前
【Prometheus·入门篇】数据模型:Metric 类型、标签与时间序列
prometheus