硬件监控:grafana+prometheus+node_exporter
一、前期准备:
grafana:前端展示平台,没有数据存储功能,但是,它有不同的展示模板,然后,把后端数据库中提供的数据,进行展示 -->展示数据
prometheus(普罗米修斯):时序数据库。数据库是存储数据,它的数据是有时间顺序。-->存数据(一般不放被测服务器)
exporter(数据收集):是通过exporter 来收集,收集不同监控数据,用不同 exporter。-->采集器(放在被测服务器上)
二、安装:prometheus
1、先启动grafana:
systemctl restart grafana-server
端口:3000
2、把 prometheus 的包上传到 非被测服务器上,即可
[root@centos7 ~]# cd /opt
[root@centos7 opt]# ls
grafana+prometheus
[root@centos7 opt]# cd grafana+prometheus/
[root@centos7 grafana+prometheus]# ls
grafana-7.4.3-1.x86_64.rpm nginx-vts-exporter-0.10.3.linux-amd64.
influxdb-1.7.0.x86_64.rpm node_exporter-1.1.1.linux-amd64.tar.gz
jmx_prometheus_javaagent-0.14.0.jar prometheus-2.20.1.linux-amd64.tar.gz
mysqld_exporter-0.12.1.linux-amd64.tar.gz redis_exporter-v1.17.1.linux-amd64.tar
nginx-module-vts.tar.gz tomcat.yml
[root@centos7 grafana+prometheus]# cd ..
[root@centos7 opt]# mkdir prometheus
[root@centos7 opt]# cd prometheus/
[root@centos7 prometheus]# ls
[root@centos7 prometheus]# ll
总用量 0
[root@centos7 prometheus]# mv /opt/grafana+prometheus/prometheus-2.20.1.linux-amd
[root@centos7 prometheus]# ll
总用量 63788
-rw-r--r--. 1 root root 65315813 7月 30 15:42 prometheus-2.20.1.linux-amd64.tar.
[root@centos7 prometheus]#
-->解压,进入解压后的 文件夹,prometheus.yml 这个文件,就是 prometheus 的配置文件
[root@centos7 prometheus]# tar -zxvf prometheus-2.20.1.linux-amd64.tar.gz
prometheus-2.20.1.linux-amd64/
prometheus-2.20.1.linux-amd64/LICENSE
prometheus-2.20.1.linux-amd64/NOTICE
prometheus-2.20.1.linux-amd64/tsdb
prometheus-2.20.1.linux-amd64/prometheus
prometheus-2.20.1.linux-amd64/console_libraries/
prometheus-2.20.1.linux-amd64/console_libraries/prom.lib
prometheus-2.20.1.linux-amd64/console_libraries/menu.lib
prometheus-2.20.1.linux-amd64/promtool
prometheus-2.20.1.linux-amd64/prometheus.yml
prometheus-2.20.1.linux-amd64/consoles/
prometheus-2.20.1.linux-amd64/consoles/node.html
prometheus-2.20.1.linux-amd64/consoles/prometheus-overview.html
prometheus-2.20.1.linux-amd64/consoles/prometheus.html
prometheus-2.20.1.linux-amd64/consoles/node-overview.html
prometheus-2.20.1.linux-amd64/consoles/index.html.example
prometheus-2.20.1.linux-amd64/consoles/node-disk.html
prometheus-2.20.1.linux-amd64/consoles/node-cpu.html
[root@centos7 prometheus]# ls
prometheus-2.20.1.linux-amd64 prometheus-2.20.1.linux-amd64.tar.gz
[root@centos7 prometheus]# cd prometheus-2.20.1.linux-amd64
[root@centos7 prometheus-2.20.1.linux-amd64]# ls
console_libraries LICENSE prometheus promtool
consoles NOTICE prometheus.yml tsdb
[root@centos7 prometheus-2.20.1.linux-amd64]# ls -l
总用量 153584
drwxr-xr-x. 2 3434 3434 38 8月 6 2020 console_libraries
drwxr-xr-x. 2 3434 3434 173 8月 6 2020 consoles
-rw-r--r--. 1 3434 3434 11357 8月 6 2020 LICENSE
-rw-r--r--. 1 3434 3434 3420 8月 6 2020 NOTICE
-rwxr-xr-x. 1 3434 3434 90933367 8月 6 2020 prometheus
-rw-r--r--. 1 3434 3434 926 8月 6 2020 prometheus.yml
-rwxr-xr-x. 1 3434 3434 51151585 8月 6 2020 promtool
-rwxr-xr-x. 1 3434 3434 15159115 8月 6 2020 tsdb
-->不做修改启动 ./prometheus 端口:9090
[root@centos7 prometheus-2.20.1.linux-amd64]# ./prometheus
level=info ts=2022-08-23T03:39:58.407Z caller=main.go:308 msg="No time or size retention was set so using the default time retention" duration=15d
level=info ts=2022-08-23T03:39:58.408Z caller=main.go:343 msg="Starting Prometheus" version="(version=2.20.1, branch=HEAD, revision=983ebb4a513302315a8117932ab832815f85e3d2)"
level=info ts=2022-08-23T03:39:58.408Z caller=main.go:344 build_context="(go=go1.14.6, user=root@7cbd4d1c15e0, date=20200805-17:26:58)"
level=info ts=2022-08-23T03:39:58.408Z caller=main.go:345 host_details="(Linux 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 centos7 (none))"
level=info ts=2022-08-23T03:39:58.408Z caller=main.go:346 fd_limits="(soft=1024, hard=4096)"
level=info ts=2022-08-23T03:39:58.408Z caller=main.go:347 vm_limits="(soft=unlimited, hard=unlimited)"
level=info ts=2022-08-23T03:39:58.453Z caller=main.go:684 msg="Starting TSDB ..."
level=info ts=2022-08-23T03:39:58.454Z caller=web.go:524 component=web msg="Start listening for connections" address=0.0.0.0:9090
3、安装采集器:收集硬件资源使用情况,所以,安装硬件资源的采集器:node_exporter
node_exporter安装与配置:
把包放到被收集的机器上解压,进入解压后的文件夹
[root@vircent7 ~]# cd /opt/
[root@vircent7 opt]# ls
apache-tomcat-8.5.56 containerd mysqldata
apache-tomcat-8.5.56.tar.gz install_Docker_Mysql57.sh
[root@vircent7 opt]# mkdir exporter
[root@vircent7 opt]# cd exporter/
[root@vircent7 exporter]# ls
[root@vircent7 exporter]# ls
node_exporter-1.1.1.linux-amd64.tar.gz
[root@vircent7 exporter]# tar -xzvf node_exporter-1.1.1.linux-amd64.tar.gz
node_exporter-1.1.1.linux-amd64/
node_exporter-1.1.1.linux-amd64/LICENSE
node_exporter-1.1.1.linux-amd64/NOTICE
node_exporter-1.1.1.linux-amd64/node_exporter
[root@vircent7 exporter]# ls
node_exporter-1.1.1.linux-amd64 node_exporter-1.1.1.linux-amd64.tar.gz
[root@vircent7 exporter]# cd node_exporter-1.1.1.linux-amd64
[root@vircent7 node_exporter-1.1.1.linux-amd64]# ls
LICENSE node_exporter NOTICE
[root@vircent7 node_exporter-1.1.1.linux-amd64]# ./node_exporter
-->启动 ./node_exporter 端口:9100
nohup ./node_exporter &
[root@vircent7 node_exporter-1.1.1.linux-amd64]# nohup ./node_exporter &
[1] 2210
[root@vircent7 node_exporter-1.1.1.linux-amd64]# nohup: 忽略输入并把输出追加到"nohup.out"
4、prometheus 与 exporter(被监控的服务器)网络要通:
-->进入prometheus的机器上 执行:telnet node_exporter_ip 9100
[root@centos7 prometheus-2.20.1.linux-amd64]# telnet 192.168.72.133 9100
Trying 192.168.72.133...
Connected to 192.168.72.133.
Escape character is '^]'.
5、修改prometheus.yml配置文件:填写 exporter的服务信息(ip和端口)
[root@centos7 prometheus-2.20.1.linux-amd64]# vim prometheus.yml
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus' # metrics_path defaults to '/metrics'
# scheme defaults to 'http'. static_configs:
- targets: ['localhost:9090'] - job_name: 'node_exporter'
static_configs:
- targets: ['192.168.72.133:9100']
-->启动prometheus:./prometheus 后台进程运行 nohup./prometheus&
[root@centos7 prometheus-2.20.1.linux-amd64]# nohup ./prometheus &
[1] 2031
[root@centos7 prometheus-2.20.1.linux-amd64]# nohup: 忽略输入并把输出追加到"nohup.out"
6、在grafana的web界面中,配置展示
http://grafana_ip:3000 admin admin
添加数据源 > 选择prometheus
name
HTTP-URL:http://prometheus_ip:9090
保存配置模板import > 12884
硬件监控:grafana+prometheus+node_exporter的更多相关文章
- Grafana+Prometheus+node_exporter监控,Grafana无法显示数据的问题
环境搭建: 被测linux机器上部署了Grafana,Prometheus,node_exporter,并成功启动了它们. Grafana中已经创建了Prometheus数据源,并测试通过,并且导入了 ...
- Centos7.X 搭建Prometheus+node_exporter+Grafana实时监控平台
Prometheus简介 什么是 Prometheus Prometheus是一个开源监控报警系统和时序列数据库 主要功能 多维数据模型(时序由 metric 名字和 k/v 的 labels 构成) ...
- Grafana+Prometheus通过node_exporter监控Linux服务器信息
Grafana+Prometheus通过node_exporter监控Linux服务器信息 一.Grafana+Prometheus通过node_exporter监控Linux服务器信息 1.1nod ...
- Centos8.X 搭建Prometheus+node_exporter+Grafana实时监控平台
Prometheus Promtheus是一个时间序列数据库,其采集的数据会以文件的形式存储在本地中,因此项目目录下需要一个data目录,需要我们自己创建,下面会讲到 下载 下载好的.tar.gz包放 ...
- Grafana+Prometheus打造全方位立体监控系统
前言 本文主要介绍如何使用Grafana和Prometheus以及node_exporter对Linux服务器性能进行监控.下面两张图分别是两台服务器监控信息: 服务器A 服务器B 概述 Promet ...
- Grafana + Prometheus 监控PostgreSQL
效果图 部署环境 服务器名称 IP地址 部署业务 备注 部署agent sht-sgmhadoopcm-01 172.16.101.54 PostgreSQL 监控服务器.被监控服务器 node_ex ...
- Grafana+Prometheus 监控 MySQL
转自:Grafana+Prometheus 监控 MySQL 架构图 环境 IP 环境 需装软件 192.168.0.237 mysql-5.7.20 node_exporter-0.15.2.lin ...
- 【开源监控】Prometheus+Node Exporter+Grafana监控linux服务器
Prometheus Prometheus介绍 Prometheus新一代开源监控解决方案.github地址 Prometheus主要功能 多维 数据模型(时序由 metric 名字和 k/v 的 l ...
- 性能测试之数据库监控分析工具Grafana+Prometheus
使用到 Grafana+Prometheus+Mysql_exportor 使用Prometheus和Grafana,可以快速的构建我们性能测试的绝大多数的监控模型:数据库监控.服务器监控.Jvm监控 ...
- 图文详解Prometheus监控+Grafana+Alertmanager告警安装使用
一:前言 一个服务上线了后,你想知道这个服务是否可用,需要监控.假如线上出故障了,你要先于顾客感知错误,你需要监控.还有对数据库,服务器的监控,等等各层面的监控. 近年来,微服务架构的流行,服务数越来 ...
随机推荐
- Nmap常用方法
1.扫描单个目标地址 在Nmap后面直接添加目标地址即可扫描 nmap 目标地址 2.扫描多个目标地址 如果目标不在同一网段,或在同一网段但不连续且数量不多,可以使用该方法进行扫描 nmap ...
- prometheus-监控docker服务器
1. prometheus-监控docker服务器 prometheus-监控docker服务器 cAdvisor(Container Advisor):用于收集正在运行的容器资源使用和性能信息. 项 ...
- APICloud平台使用融云模块实现音视频通话实践经验总结分享
需求概要:实现视频拨打.接听.挂断.视频界面大小窗口.点击小窗口实现大小窗口互换. 实现思路:一方拨打后,另一方要能收到相应事件,然后接听.接通后,渲染对方视频画面.那么己方视频画面什么时候渲染呢?对 ...
- [深度学习] tf.keras入门4-过拟合和欠拟合
过拟合和欠拟合 简单来说过拟合就是模型训练集精度高,测试集训练精度低:欠拟合则是模型训练集和测试集训练精度都低. 官方文档地址为 https://tensorflow.google.cn/tutori ...
- [Leetcode] 寻找数组的中心索引
题目 代码 class Solution { public: int pivotIndex(vector<int>& nums) { int right=0; for(auto i ...
- java 进阶P-6.2+P-6.3
细胞自动机 CellularAutomation(细胞自动机)细胞自动机(英语:Cellular automaton),又称格状自动机.元胞自动机,是一种离散模型,在可算性理论.数学及理论生物学都有相 ...
- 问题记录:VMware vSphere vCenter 7.0 上传文件失败
问题记录:VMware vSphere vCenter 7.0 上传文件失败 环境说明: VC版本:VMware vSphere vCenter 7.0 ESXi版本:VMware vSphere E ...
- 通过一个示例形象地理解C# async await 非并行异步、并行异步、并行异步的并发量控制
前言 接上一篇 通过一个示例形象地理解C# async await异步 我在 .NET与大数据 中吐槽前同事在双层循环体中(肯定是单线程了)频繁请求es,导致接口的总耗时很长.这不能怪前同事,确实难写 ...
- 关于计算机与常用DOS命令
计算机 计算机 计算机由软件和硬件组成. 能够按照程序运行,自动,高速处理海量数据的现代化智能电子设备. 计算机硬件 CPU 主板 内存 电源.主机箱 硬盘 显卡 键盘.鼠标(输入设备) 显示器(输出 ...
- 编程哲学之 C# 篇:006——什么是 .NET
本章将用本系列第二章中提到的 类比 思维来让读者快速了解什么是.NET. 当年在网上看到一个初学者问<Java编程思想>第一章看不懂怎么办.然后我发现在很多经典的技术书中,如<C#入 ...