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`
相关推荐
洛阳纸贵6 小时前
JAVA高级工程师--Elasticsearch安装以及内置分词器、IK分词器
大数据·elasticsearch·搜索引擎
Howie Zphile7 小时前
Git 拉 NocoBase 2.0 beta(next 分支),并“每天自动更新 + 自动编译 + 自动重启”
大数据·git·elasticsearch
历程里程碑7 小时前
子串----和为K的子数组
大数据·python·算法·leetcode·elasticsearch·搜索引擎·哈希算法
2401_859049088 小时前
lvgl移植到Linux踩坑
linux·运维·arm开发·elasticsearch·嵌入式·ubantu
峥嵘life10 小时前
Android EDLA CTS、GTS等各项测试命令汇总
android·学习·elasticsearch
invicinble11 小时前
一文了解git
大数据·git·elasticsearch
Elastic 中国社区官方博客12 小时前
使用 LangGraph 和 Elasticsearch 构建 人机协同( HITL )AI agent
大数据·人工智能·elasticsearch·搜索引擎·ai·机器人·全文检索
TracyCoder12313 小时前
ElasticSearch分布式架构(一):分片与路由的奥秘
分布式·elasticsearch·架构
TracyCoder12313 小时前
ElasticSearch分布式架构(二):集群一致性与共识——从Zen Discovery到Raft共识算法
分布式·elasticsearch·架构
TracyCoder12313 小时前
ElasticSearch核心引擎Apache Lucene(五):相关性算分 (Scoring)
elasticsearch·apache·lucene