prometheus+grafana实现服务监控
一、安装prometheus:
下载相应的版本 :https://prometheus.io/download/
解压:
Linux:tar -zxvf XXX.tar.gz
windows:直接下载.ism 安装程序
mac:未使用过
进入到解压后的文件夹可以直接运行:
./prometheus --config.file=prometheus.yml
浏览器打开“http://localhost:9090” 访问

二、配置启动项
方法1 直接在prometheus.yml进行配置(监控内容较少的时候):
- job_name: 'linux'
static_configs:
- targets: ['localhost:9104']
方法2 指定配置文件 :
# prometheus.yml 配置
- job_name: 'Linux'
file_sd_configs:
- files: ['/opt/prometheus/sd_cfg/Linux.yml']
# /opt/prometheus/sd_cfg/Linux.yml 中文件配置
- targets: ['IP地址:9100']
labels:
name: Linux-node1[这里建议给每个主机打个有意义的标签,方便识别.]
配置文件检查命令(检查配置是否存在错误):
./promtool check config prometheus.yml
配置文件详解:
官方文档:https://prometheus.io/docs/prometheus/latest/configuration/configuration/
其他:https://www.cnblogs.com/liujiliang/p/10080849.html
https://www.cnblogs.com/xiangsikai/p/11288835.html
创建专用用户:
groupadd prometheus
useradd -g prometheus -m -d /opt/prometheus/ -s /sbin/nologin prometheus
二、配置 Linux系统监控
node_exporter 服务安装:
下载地址:https://github.com/prometheus/node_exporter/releases/
解压命令:tar -zxvf node_exporter-xxx.tar.gz 解压完成 进入解压文件夹: cd node_exporter-xxx 启动: ./node_exporter
成功效果

三、安装配置Grafana
下载地址:https://grafana.com/grafana/download
安装编译:yum localinstall grafana-xxx.rpm
安装完成访问 : http://localhost:3000
默认账号/密码:admin/admin

配置 node_exporter监控:
网址和服务名称填写就可以了。

添加统计图模板:
模板网址:https://grafana.com/grafana/dashboards
找到模板ID

填写模板ID

效果:

教程地址:https://www.cnblogs.com/guoxiangyue/p/11772717.html
prometheus+grafana实现服务监控的更多相关文章
- prometheus + grafana部署RabbitMQ监控
prometheus + grafana部署RabbitMQ监控 1.grafana导入dashboards https://grafana.com/dashboards/2121 2.expor ...
- Prometheus+Grafana通过kafka_exporter监控kafka
Prometheus+Grafana通过kafka_exporter监控kafka 一.暴露 kafka-metric 方式 二.jmx_exporter方式 2.1 下载jmx_prometheus ...
- 【Prometheus+Grafana系列】监控MySQL服务
前言 前面的一篇文章已经介绍了 docker-compose 搭建 Prometheus + Grafana 服务.当时实现了监控服务器指标数据,是通过 node_exporter.Prometheu ...
- Prometheus+Grafana+Altermanager搭建监控系统
基本概念 Prometheus 时间序列化数据库,我的理解就是将数据打上标签,以时间维度存储.后面有机会在深入研究. Prometheus架构如下: Grafana Prometheus中存储的数据, ...
- SpringBoot+Prometheus+Grafana实现应用监控和报警
一.背景 SpringBoot的应用监控方案比较多,SpringBoot+Prometheus+Grafana是目前比较常用的方案之一.它们三者之间的关系大概如下图: 关系图 二.开发SpringBo ...
- nmon2influxdb+grafana:服务监控可视化部署
在工作中,无论是定位线上问题,还是性能优化,都需要对前端.后台服务进行监控.而及时的获取监控数据,能更好的帮助技术人员排查定位问题. 前面的博客介绍过服务端监控工具:Nmon使用方法及利用easyNm ...
- 使用prometheus+ grafana+nginx-module-vts 模块监控openresty
nginx-module-vts 是一个很不错的nginx 模块,我们可以用来,方便的分析系统的请求状态 同时支持基于prometheus 的监控, 我参考openresty 的docker镜像已 ...
- Prometheus+Grafana打造Mysql监控平台
prometheus/node_exporter/mysqld_exporter都是由go语言编写,需要先安装GoLang环境 下载node_exporter(监控服务器的CPU.内存.存储使用情况) ...
- 基于Prometheus+Grafana+AlertManager的监控系统
一.Prometheus 1.1 简介 Prometheus是一套开源的监控&报警&时间序列数据库的组合,基于应用的metrics来进行监控的开源工具 . 1.2 下载&安装 ...
随机推荐
- 题解 Time
传送门 首先枚举最大值,两边分别求逆序对的做法是错误的,这里是来自战神的hack数据 1 2 100 99 98 3 97 96 95 94 93 92 91 显然3应该跨过最大值到左边去,所以这个做 ...
- WPF---依赖属性(二)
一.概要 我们将会通过一个简单的综合例子来阐述下依赖属性的变化. 场景:我们在一个文本框中输入一个数字,然后对应的panel中会出现对应的椭圆,椭圆的个数与输入的文本相同. 我们在MainWindow ...
- Commons-Collections(二)之map
BidiMap: 双重Map 使用双向映射,可以使用值查找键,并且可以使用键轻松查找值.(自然,它可以根绝key移除,也可以根据value移除) public interface BidiMap< ...
- Java程序设计学习笔记(三)—— IO
时间:2016-3-24 11:02 --IO流(Input/Output) IO流用来处理设备之间的数据传输. Java对数据的操作是通过流的方式. Java对于操作流的对象都在 ...
- 技术调研,IDEA 插件怎么开发「脚手架、低代码可视化编排、接口生成测试」?
作者:小傅哥 博客:https://bugstack.cn 沉淀.分享.成长,让自己和他人都能有所收获! 一.前言 不踩些坑,根本不是成熟的码农! 你觉得肯德基全家桶是什么?一家人一起吃的桶吗,就那么 ...
- jquery mobile cdn
<head> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jque ...
- 如何将excel中纵向的转换成横向保证格式不变,
先选定,复制,然后用--编辑---选择性粘贴--转置--确定.试试能不能实现 ,能把文件发过来看一下
- MySQL alter table时执行innobackupex全备再看Seconds_Behind_Master
1.场景描述 早上7:25 接到Report中心同学告警,昨天业务报表数据没有完整跑出来,缺少500位业务员的数据,并且很快定位到,缺少的是huabei_order库上的数据.Report中心的数据是 ...
- ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1122)
只需执行 /Applications/Python\ 3.9/Install\ Certificates.command
- 前后端数据交互(四)——fetch 请求详解
fetch 是 XMLHttpRequest 的升级版,使用js脚本发出网络请求,但是与 XMLHttpRequest 不同的是,fetch 方式使用 Promise,相比 XMLHttpReques ...