ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

基于centos8的prometheus和grafana的性能监控平台搭建

2020-12-30 18:04:56  阅读:410  来源: 互联网

标签:exporter grafana prometheus nohup 监控 linux centos8


平台监控原理

用户-查看数据->Grafana-定时读取数据->Prometheus-存储数据->node_exporter-获取监控对象数据->对象(linux/mysql)
监控对象:linux,mysql等

prometheus简介

Prometheus是一套开源的系统监控报警框架

grafana简介

Grafana是一个跨平台的开源的度量分析和可视化工具,可以通过将采集的数据查询然后可视化的展示,并及时通知

环境搭建

监控插件exporter部署

1.下载插件:
https://github.com/prometheus/
2.将对应的exporter包上传至linux服务器上,解压
tar xvf xxx_exporter-版本号.linux-amd64.tar.gz
3.进入解压后的文件夹中,执行启动脚本
nohup ./xxx_exporter &
查看nohup日志:tail -100 nohup.out。查看是否启动成功

prometheus部署

1.下载包
https://github.com/prometheus/prometheus/releases/download/
2.将prometheus上传到一台单独的指定linux服务器上,解压
3.进入解压后的目录,修改配置文件prommetheus.yml,添加监控的服务器ip
vi prometheus.yml
/scrape_configs 检索该内容,添加linux监控的job,注意缩进,port为9100
-job_name:'node'
static_configs:
-targets:['ip:9100']
esc -> :wq
4.保存配置文件,启动prometheus
nohup ./prometheus &
检查nohup.out日志
5.检查监控情况
浏览器访问:http://ip:9090
status -> targets -> node节点 -> up :连接成功

Grafana部署

1.下载安装包
https://dl.grafana.com/oss/release/grafana-版本号.rpm
2.上传安装包到linux服务器上(和prometheus同一台)
3.安装grafana
yum localinstall -y grafana-版本号.rpm
4.启动grafana
systemctl start grafana-server
5.测试启动
浏览器访问:http://ip:3000
账密:admin/admin
6.数据源配置
添加数URL据源(add data source),选择prometheus
URL:http://localhost:9090(同台服务器上)
save and test -> success
7.查找监控模板
在grafana官网,下载自己想要的模板
https://grafana.com/grafana/dashboards
记录对应模板id
8.导入监控模板

  • -> import -> id -> load -> name/prometheus data source(prometheus) -> import
    9.修改配置项
    数据更新频率 -> 5s
    展示最近x分钟 -> 5min
    10.监控项
    cpu,load,内存,网络,磁盘,IO耗时等

标签:exporter,grafana,prometheus,nohup,监控,linux,centos8
来源: https://www.cnblogs.com/dylannnnn/p/14202539.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有