6.监控elasticsearch集群---放弃采用(获取不到数据),建议看另一篇文章:监控elasticsearch
prometheus监控es,同样采用exporter的方案。
- 项目地址:
- elasticsearch_exporter:https://github.com/justwatchcom/elasticsearch_exporter
1、安装部署
现有es三节点的集群,环境大概如下:
| 主机 | 组件 |
|---|---|
| 192.168.75.11 | prometheus |
| 192.168.75.21 | es,kibana,nginx |
接着分别在如上三台主机上进行如下配置:
wget https://github.com/justwatchcom/elasticsearch_exporter/releases/download/v1.1.0/elasticsearch_exporter-1.1.0.linux-amd64.tar.gz
tar -zxv -f elasticsearch_exporter-1.1.0.linux-amd64.tar.gz
mv elasticsearch_exporter-1.1.0.linux-amd64 /usr/local/elasticsearch_exporter
创建用户等
groupadd prometheus
useradd -g prometheus -m -d /var/lib/prometheus -s /sbin/nologin prometheus
chown -R prometheus.prometheus /usr/local/elasticsearch_exporter
启动监控客户端:
nohup ./elasticsearch_exporter --web.listen-address ":9308" --es.uri http://192.168.75.21:9200 &
使用systemd管理:
cat /lib/systemd/system/es_exporter.service
[Unit]
Description=The es_exporter
After=network.target
[Service]
Type=simple
User=prometheus
ExecStart=/usr/local/elasticsearch_exporter/elasticsearch_exporter --web.listen-address ":9308" --es.uri http://192.168.75.21:9200
Restart=on-failure
[Install]
WantedBy=multi-user.target
启动:
systemctl daemon-reload
systemctl start es_exporter
systemctl enable es_exporter
查看metrics:
curl 127.0.0.1:9308/metrics
2,配置 prometheus.yml 添加监控目标
vim /usr/local/prometheus/prometheus.yml
- job_name: 'elasticsearch'
scrape_interval: 60s
scrape_timeout: 30s
metrics_path: "/metrics"
static_configs:
- targets: ['192.168.75.21:9308']
labels:
service: elasticsearch
重启服务。
systemctl restart prometheus
或者通过命令热加载:
curl -XPOST localhost:9090/-/reload
5,配置 Grafana 的模板
模板通过json文件进行导入,文件就在解压的包内。
参考地址:https://shenshengkun.github.io/posts/550bdf86.html
或者通过如下ID进行导入:2322以及其他。



6,开启认证的启动方式
如果es开启了认证,那么启动的时候需要将用户名密码加载进去:
elasticsearch_exporter --web.listen-address ":9308" --es.uri http://username:password@192.168.75.21:9200 &
其中使用的是monitoring的用户密码。
当然,除去这种命令行的启动方式之外,还可以像上边一样,基于systemd进行管理,只需将认证的参数信息写入到如下内容当中:
参考网址:https://github.com/justwatchcom/elasticsearch_exporter

cat /etc/default/elasticsearch_exporter
[Unit]
Description=The es_exporter
After=network.target
[Service]
Type=simple
User=prometheus
ExecStart=/usr/local/elasticsearch_exporter/elasticsearch_exporter --web.listen-address ":9308" --es.uri=http://username:password@192.168.75.21:9200
Restart=on-failure
[Install]
WantedBy=multi-user.target

6.监控elasticsearch集群---放弃采用(获取不到数据),建议看另一篇文章:监控elasticsearch的更多相关文章
- shell脚本监控k8s集群job状态,若出现error通过触发阿里云的进程监控报警
#!/bin/bash while [ 1 ] do job_error_no=`kubectl get pod -n weifeng |grep -i "job"|grep -c ...
- Elasticsearch集群 管理
第7章 深入Elasticsearch集群 启动一个Elasticsearch节点时,该节点会开始寻找具有相同集群名字并且可见的主节点.如 果找到主节点,该节点加入一个已经组成了的集群:如果没有找到, ...
- 手把手教你搭建一个 Elasticsearch 集群
为何要搭建 Elasticsearch 集群 凡事都要讲究个为什么.在搭建集群之前,我们首先先问一句,为什么我们需要搭建集群?它有什么优势呢? 高可用性 Elasticsearch 作为一个搜索引擎, ...
- ElasticSearch 集群监控
要监控哪些 ElasticSearch metrics? Elasticsearch 提供了大量的 Metric,可以帮助您检测到问题的迹象,在遇到节点不可用.out-of-memory.long g ...
- zabbix监控Elasticsearch集群
本节以 zabbix 为例,介绍如何使用监控系统完成 Elasticsearch 的监控报警. github 上有好几个版本的 ESZabbix 仓库,都源自 Elastic 公司员工 unterge ...
- Prometheus监控elasticsearch集群(以elasticsearch-6.4.2版本为例)
部署elasticsearch集群,配置文件可"浓缩"为以下: cluster.name: es_cluster node.name: node1 path.data: /app/ ...
- Elasticsearch 集群优化-尽可能全面详细
Elasticsearch 集群优化-转载参考1 基本配置 基本配置,5台配置为 24C 125G 17T 的主机,每台主机上搭建了一个elasticsearch节点. 采用的elasticsearc ...
- Docker部署Elasticsearch集群
http://blog.sina.com.cn/s/blog_8ea8e9d50102wwik.html Docker部署Elasticsearch集群 参考文档: https://hub.docke ...
- Elasticsearch 集群 单服务器 超级详细教程
前言 之前了解了Elasticsearch的基本概念.将spring boot + ElasticSearch + head插件 搞通之后.紧接着对es进行下一步的探索:集群.查阅资料的过程中,找到了 ...
随机推荐
- RESTAPI 版本控制策略【eolink 翻译】
微服务,是现阶段开发建设云原生应用程序的流行趋向.API 版本控制有益于在辨别出所需要的调节时加速迭代更新的速度. 根据微服务架构的关键构件其一,是 API 的设计和规范.针对 API,版本控制是不可 ...
- Leetcode 1331. 数组序号转换
给你一个整数数组 arr ,请你将数组中的每个元素替换为它们排序后的序号. 序号代表了一个元素有多大.序号编号的规则如下: 序号从 1 开始编号. 一个元素越大,那么序号越大.如果两个元素相等,那么它 ...
- day07 聊天室-1_集合
聊天室(续) 实现服务端发送消息给客户端 在服务端通过Socket获取输出流,客户端获取输入流,实现服务端将消息发送给客户端. 这里让服务端直接将客户端发送过来的消息再回复给客户端来进行测试. 服务端 ...
- 应用启动加速-并发初始化spring bean
背景 随着需求的不断迭代,服务承载的内容越来越多,依赖越来越多,导致服务启动慢,从最开始的2min以内增长到5min,导致服务发布很慢,严重影响开发效率,以及线上问题的修复速度.所以需要进行启动加速. ...
- 【USACO 2012 Open】奶牛赛跑_题解
奶牛赛跑 目录 奶牛赛跑 题目描述 输入格式 输出格式 样例 样例输入#1 样例输出#1 题解 代码 题目描述 约翰有头奶牛,他为这些奶牛准备了一个周长为的环形跑牛场.所有奶牛从起点同时起跑,奶牛在比 ...
- MySQL之JDBC编程增删改查
MySQL之JDBC 一.JDBC是什么 Java DatabaseConnectivity (java语言连接数据库) 二.JDBC的本质 JDBC是SUN公司制定的一套接口(interface). ...
- 美女 Committer 手把手教你使用海豚调度
还在为选哪个调度发愁么?还在为查使用手册愁眉不展么?来来来,先瞧一眼海豚调度的 Slogan:调度选的好,下班回家早.调度用的对,半夜安心睡.为充分贯彻这一宗旨,海豚调度一条龙服务来了,特地邀请海豚社 ...
- 原生js也可以自定义组件
Web Components 是一套不同的技术,允许您创建可重用的定制元素(它们的功能封装在您的代码之外)并且在您的web应用中使用它们. 它由三项主要技术组成,它们可以一起使用来创建封装功能的定制元 ...
- 个人学习记录-Cpp基础-成员初始化列表
Translator Translator 参考链接: https://blog.csdn.net/XIONGXING_xx/article/details/115553291http ...
- LuoguP1922 女仆咖啡厅桌游吧 (树形动态规划)
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> ...