Grafana 是一款开源的可视化和分析软件。 它允许查询、可视化、警告和探索项目的各种指标,无论它们存储在哪里。 简单地说,它为你提供了将时间序列数据库(TSDB)数据转换为漂亮的图形和可视化的工具。
第一步 安装grafana
grafana支持的操作系统涵盖了目前主流的所有的操作系统,linux(Ubuntu,centos,macos,windows等)
当然也支持在容器中安装和使用(Docker 镜像)
例如:ubuntu环境的安装
sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
# Alternatively you can add the beta repository, see in the table above
sudo add-apt-repository "deb https://packages.grafana.com/enterprise/deb stable main"
sudo apt-get update
sudo apt-get install grafana-enterprise
第二步 启动服务
用 systemd 启动服务器
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
当然也可以,配置 Grafana 服务器在启动时启动
sudo systemctl enable grafana-server.service
第三步 登录到服务
1、打开你的网页浏览器,进入 http://localhost:3000/ 。 如果没有配置其他端口,Grafana 将监听默认的 HTTP 端口3000。
2、在登录页面上,键入 admin 作为用户名和密码。(缺省账号密码:admin/admin)
3、修改缺省密码
第四步 开始使用Dashboard
1、单击 New dashboard。
2、单击添加查询,Grafana 使用随机漫步场景创建一个基本的图形面板。
3、保存你的仪表盘。 点击屏幕上方的保存仪表板图标。
其他的可选操作
1、创建用户、角色、权限等,目的是为了后继对于展现出来的数据有各自的权限,查看,编辑效果等
2、编辑数据源,数据的来源
3、还有各种插件,例如:服务器健康状态的插件,各种数据库的(mysql、postgre、tidb等)
https://grafana.com/grafana/plugins?orderBy=weight&direction=asc