前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >搭建Grafana+Prometheus监控平台

搭建Grafana+Prometheus监控平台

作者头像
用户6792968
发布2022-08-30 12:17:54
2850
发布2022-08-30 12:17:54
举报
文章被收录于专栏:fred 随笔fred 随笔

本文采用二进制源码安装方式,安装环境如下

操作系统

Grafana版本

Prometheus版本

Alibaba Cloud Linux 3

8.5.4

2.36.0

1、安装Prometheus

release地址:https://github.com/prometheus/prometheus/releases

代码语言:javascript
复制
#下载Prometheus二进制包
wget  https://ghproxy.com/https://github.com/prometheus/prometheus/releases/download/v2.36.0/prometheus-2.36.0.linux-amd64.tar.gz
tar xf prometheus-2.36.0.linux-amd64.tar.gz  -C /opt/
mv /opt/prometheus-2.36.0.linux-amd64 /opt/prometheus

#将prometheus添加至systemd管理
cat << eof >> /etc/systemd/system/prometheus.service
[Unit]
Description=logging prometheus service
Documentation=https://prometheus.io

[Service]
Type=simple
User=root
Group=root
ExecStart=/opt/prometheus/prometheus  --web.enable-lifecycle --config.file=/opt/prometheus/prometheus.yml
Restart=on-failure

[Install]
WantedBy=multi-user.target
eof
systemctl daemon-reload
systemctl start prometheus.service
systemctl enable prometheus.service
  • prometheus默认监听在9090端口,安全组与防火墙放行后可以直接访问:http://IP:9090/gragh 进行访问
image-1654248175119
image-1654248175119

2、安装Grafana面板

官方release:https://grafana.com/grafana/download

代码语言:javascript
复制
wget https://dl.grafana.com/oss/release/grafana-8.5.4.linux-amd64.tar.gz
tar -zxvf grafana-8.5.4.linux-amd64.tar.gz  -C /opt/
mv /opt/ grafana-8.5.4/ /opt/grafana
mkdir /opt/grafana/data
sed -i 's/data\/plugins/plugins-bundled/g'    /opt/grafana/conf/defaults.ini
#将grafana添加至systemd管理
cat << eof >> /etc/systemd/system/grafana.service
[Unit]
Description=logging Grafana service
Documentation=https://grafana.com/

[Service]
Type=simple
User=root
Group=root
ExecStart=/opt/grafana/bin/grafana-server  --homepath /opt/grafana/  web
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=on-failure

[Install]
WantedBy=multi-user.target
eof
systemctl  daemon-reload
systemctl  start grafana.service
systemctl  enable  grafana.service
  • grafana默认监听在3000端口,可以访问:http://IP:3000 进行访问,默认用户密码是:admin
image-1654247790390
image-1654247790390

3、添加Prometheus数据源

image-1654248238983
image-1654248238983
image-1654248255339
image-1654248255339
image-1654248417579
image-1654248417579
  • 导入Prometheus默认的监控大屏
image-1654248500566
image-1654248500566
image-1654248537929
image-1654248537929
image-1654248555403
image-1654248555403
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1、安装Prometheus
  • 2、安装Grafana面板
  • 3、添加Prometheus数据源
相关产品与服务
Grafana 服务
Grafana 服务(TencentCloud Managed Service for Grafana,TCMG)是腾讯云基于社区广受欢迎的开源可视化项目 Grafana ,并与 Grafana Lab 合作开发的托管服务。TCMG 为您提供安全、免运维 Grafana 的能力,内建腾讯云多种数据源插件,如 Prometheus 监控服务、容器服务、日志服务 、Graphite 和 InfluxDB 等,最终实现数据的统一可视化。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档