centos8查看服务器性能,基于centos8的prometheus和grafana的性能监控平台搭建

平台监控原理

用户-查看数据->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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值