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 下载&安装 ...
随机推荐
- 题解 [AHOI2017/HNOI2017]大佬
传送门 注意到题面里n很小,有\(n\leq100\) 考虑联系n的实际意义 n是你在大佬手中能活的天数 题面颇富深意 好了不闹了 n很小,对于\(40\%\)的数据,爆搜即可 考场上靠这个骗了40p ...
- MYSQL数据库查询索引
1.查看数据库所有索引 SELECT * FROM mysql.`innodb_index_stats` a WHERE a.`database_name` = '数据库名'; 2.查看某一表索引 S ...
- Spring-Boot-Bean的使用,@Repository,@Service,@Controller,@Component
前言 在Spring MVC的时候,我们使用xml来配置bean,如今的Spring boot推荐我们使用元注解的发生,那就听Spring Boot的推荐,下面我就为大家来介绍下Spring Boot ...
- SpringCloud之Hystrix集群监控turbine仪表盘
1.引入 在前一节中我们演示了单机模式下Hystrix服务监控Dashboard仪表盘,但是在实际生产中微服务都是集群模式, 为了更接近世界生产,我们在这里也给大家讲一下如何监控集群模式 2.准备工作 ...
- wpf 富文本编辑器richtextbox的简单用法
最近弄得一个小软件,需要用到富文本编辑器,richtextbox,一开始以为是和文本框一样的用法,但是实践起来碰壁之后才知道并不简单. richtextbox 类似于Word,是一个可编辑的控件.结构 ...
- 本文详细阐述如何用C#创建COM组件,并能用VC6.0等调用。
本文详细阐述如何用C#创建COM组件,并能用VC6.0等调用. 附:本文适用任何VS系列工具. 在用C#创建COM组件时,一定要记住以下几点: 1.所要导出的类必须为公有: 2.所有属性.方法也必须为 ...
- Maven脑图
转自:https://segmentfault.com/a/1190000017832792 参考:https://www.cnblogs.com/mzywucai/p/11053341.html
- OJ 注意事项
1,检查指针是否有效,即是否为NULL 1 void OutputMaxAndMin(int * pInputInteger, int InputNum, int * pMaxValue, int * ...
- MediaWiki 语法简介
本文尚在完善中... 图片 图片官方教程 图文并茂的内容读起来总是更加舒服,让我们在wiki里引入图片. 内部图片 上传图片 点击右侧上传文件,上传文件后会获得文件名 编辑图片 文件上传后在编辑框,如 ...
- 【WPF】 OxyPlot图表控件学习
最近在学习OxyPlot图表控件,一些基本的学习心得,在这里记录一下,方便以后进行查找. 一.引用 OxyPlot控件可以直接在VS的 " Nuget " 里面下载 选择: ...