Grafana在前面整理监控工具之Prometheus的文章里,也有提到和使用过,但没有详细提及。这里专门列出一篇介绍Grafana工具,希望能帮助到需要的朋友。

一,简介

Grafana是一个开源的度量分析与可视化套件。经常被用作基础设施的时间序列数据和应用程序分析的可视化。

Grafana支持许多不同的数据源。每个数据源都有一个特定的查询编辑器,该编辑器定制的特性和功能是公开的特定数据来源。官方支持以下数据源:Graphite,InfluxDB,OpenTSDB,Prometheus,Elasticsearch,CloudWatch和KairosDB。

二,Grafana图形展示工具安装

[root@monitor prometheus]# rpm -ivh grafana-4.2.0-1.x86_64.rpm

警告:grafana-4.2.0-1.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID 24098cb6: NOKEY

准备中... ################################# [100%]

正在升级/安装...

1:grafana-4.2.0-1 ################################# [100%]

### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd

sudo /bin/systemctl daemon-reload

sudo /bin/systemctl enable grafana-server.service

### You can start grafana-server by executing

sudo /bin/systemctl start grafana-server.service

POSTTRANS: Running script

三,Grafana服务启动

[root@monitor prometheus]# systemctl start grafana-server

[root@monitor prometheus]# systemctl status grafana-server

● grafana-server.service - Grafana instance

Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; disabled; vendor preset: disabled)

Docs: http://docs.grafana.org

Main PID: 1391 (grafana-server)

Memory: 7.4M

CGroup: /system.slice/grafana-server.service

└─1391 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile= cfg:default.paths.logs=/var/log/grafana cfg:default.paths.data=/var/lib/grafana cfg:default.paths.plugins=/var/lib/g...

........

9月 28 08:25:40 monitor grafana-server[1391]: t=+0800 lvl=info msg="Executing migration" logger=migrator id="add unique index data_source.account_id_name"

9月 28 08:25:40 monitor grafana-server[1391]: t=+0800 lvl=info msg="Executing migration" logger=migrator id="drop index IDX_data_source_account_id - v1"

四,Grafana登录

浏览器登录http://ip:3000登录,账号密码为admin/admin

五,添加数据源

Grafana默认支持的数据源如下:

[root@monitor datasource]# pwd

/usr/share/grafana/public/app/plugins/datasource

[root@monitor datasource]# ls -la

总用量 24

drwxr-xr-x 11 root root 159 9月 28 08:22 .

drwxr-xr-x 5 root root 131 9月 28 08:22 ..

drwxr-xr-x 5 root root 4096 9月 28 08:22 cloudwatch

drwxr-xr-x 5 root root 4096 9月 28 08:22 elasticsearch

drwxr-xr-x 3 root root 222 9月 28 08:22 grafana

drwxr-xr-x 3 root root 206 9月 28 08:22 grafana-live

drwxr-xr-x 6 root root 4096 9月 28 08:22 graphite

drwxr-xr-x 5 root root 4096 9月 28 08:22 influxdb

drwxr-xr-x 2 root root 206 9月 28 08:22 mixed

drwxr-xr-x 5 root root 4096 9月 28 08:22 opentsdb

drwxr-xr-x 6 root root 4096 9月 28 08:22 prometheus

此处添加Prometheus数据源

六,安装dashboards仪表插件

git clone https://github.com/percona/grafana-dashboards.git 下载

cp -r grafana-dashboards/dashboards /var/lib/grafana

--------高版本不用做--------

运行命令,给Grafana打补丁,不然图标不能正常显示

sed -i 's/expr=(.).replace((.).expr,(.).scopedVars(.*)var (.)=(.).interval/expr=1.replace(2.expr,3.scopedVars4var 5=1.replace(6.interval, 3.scopedVars)/' /usr/share/grafana/public/app/plugins/datasource/prometheus/datasource.js

sed -i 's/,range_input/.replace(/"{/g,""").replace(/},range_input/; s/step_input:""/step_input:this.target.step/' /usr/share/grafana/public/app/plugins/datasource/prometheus/query_ctrl.js

七,导入模板

在dashboards manage中,import prometheus模板

在dashboards中可以查看已经导入的仪表板,选择Prometheus

八,查看监控数据

grafana官方使用文档_可视化监控展示工具之Grafana,安装部署和使用相关推荐

  1. grafana官方使用文档_使用 Loki 采集微服务日志

    前面我们介绍了 Grafana Labs 推出了 Loki V2 版本,新版本提供了不少新的特性,这里我们就来介绍下如何在 Kubernetes 上使用新版本的 Loki 吧. 在配置 Loki 之前 ...

  2. grafana官方使用文档_5. Centos7 下部署使用 nmon2influxdb

    This application take a nmon file and upload it in a InfluxDB database. It generates also a dashboar ...

  3. DZZOffice(大桌子)企业文档协同平台教程系列(一)——安装部署教程

    一.DZZOffice介绍 Dzzoffice是一套开源办公套件,适用于企业.团队搭建自己的 类似"Google企业应用套件"."微软Office365"的企业 ...

  4. debian10新建文档_图解Debian 10(Buster)安装步骤

    Debian 项目发布了它的最新稳定版 Debian 10,其代号是 "Buster",这个发布版将获得 5 年的支持.Debian 10 可用于 32 位和 64 位系统.这个发 ...

  5. python3 chm文档下载_python3.7.0官方参考文档 最新api文档 chm_Python教程_源雷技术空间...

    资源名称:python3.7.0官方参考文档 最新api文档 chm 1.新语法特性: PEP 563, 推迟评估类型注释 2.向后不兼容语法更改: async 和 await 现在保留关键字 3.新 ...

  6. golang中文文档_【译】Go 语言源码贡献官方指导文档

    以前给 Go 语言项目源码提交过一些 commits,期间阅读他们的官方指导文档的时候觉得这篇指导文档可以作为绝佳的关于大型软件项目的规范管理的参考,因为最近又提交了几个 commits,就又把这篇文 ...

  7. 【Auto.JS】Autojs官方提取文档使用说明函数 (2)

    接上一篇文章:Autojs官方提取文档使用说明函数 (1) Images Stability: 2 - Stable images模块提供了一些手机设备中常见的图片处理函数,包括截图.读写图片.图片剪 ...

  8. dita文档_使用DITADoclet和DITA API专业化生成DITA Java™API参考文档

    dita文档 2009年12月11日修订说明:在" 目标"和" 安装org.dita.dost插件 "标题下添加了两个指向可下载资源的链接. 2014年3月7日 ...

  9. 学习记录《Simulink 快速入门 —— 官方Help文档》

    Simulink 快速入门 -- 官方Help文档 1. Simulink 模块图 2 创建简单模型 2.1 打开新模型 2.2 打开 Simulink库浏览器 2.2.1将模块添加到模型 2.2.2 ...

最新文章

  1. 30个Python常用极简代码,拿走就用
  2. html文本框填充颜色逐渐减少,web前端面试题之htmlcss篇
  3. 关闭Outlook自动完成功能
  4. Linux原始套接字学习总结
  5. 基于能量或过零率的实时语音分割--学习笔记
  6. SQL2005 DDL触发器
  7. 97.用好浏览器的缓存
  8. 【BZOJ4480】快乐的jyy(统计两个字符串中相同的回文串-回文树合并)
  9. STM8L 库下载地址
  10. MS08067红队攻防班 第五期开班啦!(2021年最后一期)
  11. Easyui文件上传格式限制
  12. 【杂】Excel中匹配筛选操作VLOOKUP 函数使用问题排查
  13. 想知道微信怎么做指纹支付开发?看这里!
  14. “苏宁SAP上线“有感(原)
  15. 关于 人工智能的理解
  16. Love for music
  17. 2019牛客暑期多校9H:Cutting Bamboos【主席树+二分】
  18. 超简单的canvas绘制地图
  19. 【技术类】【ArcGIS对国产卫星的支持2:高分一号卫星】篇2、高分一号(GF-1)卫星影像数据介绍
  20. power 相关:(二)功耗的分析 —— power compiler

热门文章

  1. nanoflann库
  2. Hololens2-OpenXR开发(二)-实现通讯
  3. 强化学习(二)- 动态规划(Dynamic Programming)
  4. 数据库低端sql查询语句片段
  5. 【力扣网练习题】删除排序数组中的重复项
  6. 在Uubuntu 14.04 64bit上搭建NumPy函数库环境
  7. Maya 2022中的硬表面建模技术学习视频教程
  8. Houdini魔法特效制作学习教程
  9. 手把手教你 用C++实现一个 可持久化 的http_server
  10. [SDOI2017]天才黑客