在Ubuntu或Debian上安装Grafana
在本文中,我将向你展示如何在基于Ubuntu或debian的系统上安装Grafana。
在终端中,添加此命令sudo apt-get install -y apt-transport-https
现在启用software-properties-common包,以便你可以添加额外的存储库:sudo apt-get install -y software-properties-common wget
使用wget获取GPG密钥并将它添加到系统:wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -sudo apt-get update
然后安装Grafana:sudo apt-get install grafana
现在你已经安装了Grafana,看看如何正确设置它。
配置Grafana
启动Grafana服务:sudo systemctl daemon-reloadsudo systemctl start grafana-server
你还应该启用此服务,以便在每次系统引导时启动Grafana:sudo systemctl enable grafana-server.service
Grafana与web服务类似,因此你需要从浏览器访问它,打开浏览器,并转到http://localhost:3000/。
在登录页面中使用默认的用户名和密码,如果你正在访问网络中其他计算机上的Grafana,请使用计算机的IP地址,3000是默认的HTTP端口。用户名:admin
密码:admin
强烈建议使用强密码创建新用户,之后,出于安全目的,你可以禁用或删除默认的admin用户。
设置你的第一个仪表板
在开始监视内容之前,需要在配置菜单中包括数据库。Grafana添加数据库
配置好数据源之后,就可以继续设计仪表板了。