Prometheus 集成 Node Exporter
文章首发于公众号《程序员果果》
地址:https://mp.weixin.qq.com/s/40ULB9UWbXVA21MxqnjBxw
简介
Prometheus 官方和一些第三方,已经把一些常用数据库、系统、中间件等的指标数据的采集做成了一个个 exporter,在生产环境中,直接导入使用就可以。 这一节,我们就用 Prometheus 官方提供的 Node Exporter 来完成对Linux系统运行数据的采集 。
实验
Node Exporter 安装及运行
在一台 Linux 机器上安装并运行 Node Exporter,我使用的是一台 ip 为 172.16.2.101 的Linux 虚拟机。
下载地址:https://github.com/prometheus/node_exporter/releases
下载并解压:
wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
tar zxvf node_exporter-0.18.1.linux-amd64.tar.gz
进入 node_exporter-0.18.1.linux-amd64 文件夹 启动node_exporter:
./node_exporter
Prometheus 配置
在 prometheus.yml 中配置 node_exporter 的metrics 端点,内容如下:
global:
scrape_interval: 5s
evaluation_interval: 5s
scrape_timeout: 5s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'linux-exporter'
metrics_path: /metrics
static_configs:
- targets: ['172.16.2.101:9100']
启动 prometheus:
docker run --name prometheus -d -p 9090:9090 -v /root/prometheus-data:/prometheus-data \
prom/prometheus --web.enable-lifecycle --config.file=/prometheus-data/prometheus.yml
访问 http://172.16.2.101:9090/targets 发现已经出现了 target “node_exporter” ,并且为UP状态。

Grafana 导入 DashBoard
Grafana 官方和社区对已经做好了常用的 DashBoard,可以访问 https://grafana.com/grafana/dashboards 进行查询:

选择下载最多的,点击进去:

DashBoard 的 id 为 8919,后面要用到。
启动 Grafana
docker start grafana
通过Grafana的 + 图标导入(Import) Node Exporter dashboard:
- grafana id = 8919
- 注意选中prometheus数据源


点击 "Import" 会跳转到 监控界面:

通过界面可以直观的看到 主机cpu占用率 、负载、磁盘空间、内存等信息。
总结
这一节 ,通过集成 Node Exporter 来演示了 exporter 的使用。之后你可以利用Prometheus 官方提供的其他 exporter 应用到你的学习或工作中,例如 MySQL Server Exporter 、Redis exporter 等等。
往期内容
欢迎扫码或微信搜索公众号《程序员果果》关注我,关注有惊喜~

Prometheus 集成 Node Exporter的更多相关文章
- Prometheus exporter的Node exporter是可以独立安装,用来测试的
现在慢慢在把prometheus operator的一些概念组织完整. https://github.com/coreos/prometheus-operator/tree/master/contri ...
- 【开源监控】Prometheus+Node Exporter+Grafana监控linux服务器
Prometheus Prometheus介绍 Prometheus新一代开源监控解决方案.github地址 Prometheus主要功能 多维 数据模型(时序由 metric 名字和 k/v 的 l ...
- Prometheus + Node Exporter + Grafana 监控主机运行信息
上一篇文章中讲了如何利用Prometheus和Grafana监控SpringBoot应用的JVM信息,这次就来看看如何监控 服务器运行状态,先列出用到的工具: Prometheus node_ex ...
- Prometheus 使用之 node exporter
本文使用的 Prometheus 版本为 2.22.0,node exporter 版本为 1.0.1:部署在 Linux 服务器Prometheus 是开源的监控报警系统和时序列数据库 (TSDB) ...
- Prometheus Node_exporter 之 Node Exporter
Node Exporter 1. Node Exporter Scrape Time type: GraphUnit: secondsLabel: Seconds{{collector}} - 各个收 ...
- Prometheus 安装Grafana与Prometheus集成
Prometheus 安装Grafana与Prometheus集成 Grafana是一个开源的度量分析和可视化系统. 下载地址:https://grafana.com/grafana/download ...
- Node Exporter监控指标
访问http://localhost:9100/metrics,可以看到当前node exporter获取到的当前主机的所有监控数据,如下所示: 每一个监控指标之前都会有一段类似于如下形式的信息: # ...
- node exporter
在prometheus中负责数据汇报的程序统一叫做exporter; 负责主机信息收集的node_exporter 可以利用prometheus的static_configs来拉取node_expor ...
- zeebe 集成elasticsearch exporter
zeebe 目前还在一直的开发中,同时一些变动还是挺大的,比如simple monitor 的以前是不需要配置HazelcastExporter的 估计是为了进行集群功能处理,新添加的,以前写的配置基 ...
随机推荐
- Linux命令学习-cd命令
Linux中,cd命令的全称是change directory,即改变目录的意思,主要用于切换工作目录到指定目录. 假设当前处于wintest用户的主目录,路径为 /home/wintest ,存在文 ...
- Android native进程间通信实例-socket本地通信篇之——服务端进程异常退出解决办法
导读: 好难受啊,为什么服务端说挂就挂,明明只是客户端关闭而已,服务端怎么能挂呢? 想想,如果手机上使用一个聊天程序的时候,手机端关闭了聊天程序,那么远端服务器程序总不能说挂就挂吧!所以一定要查明真相 ...
- 使用wincc vbs脚本查找进程及如何运行进程
使用vbs代码查看某个进程是否在运行,本文要检查的进程名为 QRscan.exe,其代码如下: sub CheckProcess Dim WMI,Objs,Process,ObjSet WMI=Get ...
- linux 安装命令 nginx 部署
[TOC] # 安装anocanda wget https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh安装:bash A ...
- css基础5
今天在这里跟大家分享css基础最核心的部分,浮动和定位.话不多说,直接上干货! 一.浮动 定义:定位元素是相对于其正常位置应该出现的位置.定位元素的位置是相对于自身.父级元素位置.其他元素以及浏览器窗 ...
- +p解决vim粘贴自动缩进。 数字gg跳到vim指定行。 vim查找到后,enter键修改
+p解决vim粘贴自动缩进. 数字gg跳到vim指定行. vim查找到后,enter键修改
- 洛谷P1129 [ZJOI2007]矩阵游戏 题解
题目链接:https://www.luogu.org/problemnew/show/P1129 分析: 这道题不是很好想,但只要想的出来,代码不成问题. 思路1 举几个例子,我们发现, 对于任何数来 ...
- Spring集成Shiro使用小结
shiro的认证流程 Application Code:应用程序代码,由开发人员负责开发的 Subject:框架提供的接口,代表当前用户对象 SecurityManager:框架提供的接口,代表安全管 ...
- [leetcode]95 Unique Binary Search Trees II (Medium)
原题 字母题添加链接描述 一开始完全没有思路.. 百度看了别人的思路,对于这种递归构造的题目还是不熟,得多做做了. 这个题目难在构造出来.一般构造树都需要递归. 从1–n中任意选择一个数当做根节点,所 ...
- MySql(Linux)
百度云:链接:http://pan.baidu.com/s/1jHQtPau 密码:elr8 官方下载网址:http://dev.mysql.com/downloads/mysql/