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`
相关推荐
Dxy123931021641 分钟前
Elasticsearch如何做向量搜索
大数据·elasticsearch
cui_win1 小时前
Elasticsearch 分片满了?「cluster.max_shards_per_node」报错
大数据·elasticsearch·搜索引擎
Elasticsearch2 小时前
使用 Node.js Elasticsearch 客户端索引大型 CSV 文件
elasticsearch
Elastic 中国社区官方博客3 小时前
Elasticsearch:构建一个 AI 驱动的电子邮件钓鱼检测
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
Elastic 中国社区官方博客3 小时前
Kibana 数据可视化的新配色方案 —— 我们如何以及为什么创建它
大数据·elasticsearch·搜索引擎·信息可视化·全文检索·kibana
Elastic 中国社区官方博客5 小时前
Elastic 在 AWS re:Invent:总结一年在 agentic AI 创新中的合作
大数据·人工智能·elasticsearch·搜索引擎·云计算·全文检索·aws
叮咚侠6 小时前
将已创建的Elasticsearch 8.12.0的docker容器中的数据挂载到宿主机操作步骤
运维·elasticsearch·docker·容器·kibana
liliangcsdn6 小时前
elasticsearch多字段组合查询示例
大数据·elasticsearch·搜索引擎
野生技术架构师6 小时前
SpringBoot+Elasticsearch实现高效全文搜索
spring boot·elasticsearch·jenkins
武子康6 小时前
大数据-189 Nginx JSON 日志接入 ELK:ZK+Kafka+Elasticsearch 7.3.0+Kibana 实战搭建
大数据·后端·elasticsearch