Grafana安装手册
作者:互联网
本文档说明如何安装Grafana依赖项,下载和安装Grafana,在Debian或Ubuntu系统上启动并运行该服务以及安装软件包的详细信息。
参考文档:https://grafana.com/docs/grafana/latest/installation/debian/#2-start-the-server
1. 下载并安装
使用官方APT存储库,下载.deb
软件包或下载二进制.tar.gz
文件来安装Grafana 。
这里是通过.deb
软件包下载安装的。
APT repository安装
安装的版本为grafana-7.0.3:
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/oss/deb stable main"
sudo apt-get update
sudo apt-get install grafana
-
如果在命令
add-apt-repository
遇到问题,可以设置存储库。Add this repository for stable releases:
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
如果需要beta版本,请添加此存储库:
echo "deb https://packages.grafana.com/oss/deb beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
2. 启动服务器
grafana-server
服务器将以grafana
用户身份启动,该过程是软件包安装时创建的。
如果安装了APT存储库或.deb
软件包,则可以使用systemd
或启动服务器init.d
。
用systemd启动服务器
启动服务并验证服务已启动:
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
配置Grafana服务器和systemctl启动:
sudo systemctl enable grafana-server.service
至此已经完成安装并可以启动Grafana服务器。
Grafana入门
首次登陆
- 打开我们的Web浏览器,然后转到 http://localhost:3000/ 。如果未配置其他端口,3000则是Grafana侦听的默认HTTP端口。
- 在登录页面上,默认用户名和密码均为
admin
。 - 可按照需求更改登陆密码。
创建dashboard
- 点击 New dashboard.
- 点击 Add Query. Grafana使用Random Walk场景创建一个基本的图形面板。
- 保存我们的dashboard. 点击 Save dashboard 图标保存.
恭喜,我们已经开始使用Grafana!更多功能可探索下一节。
Next steps
Different user types will have different interests. Some suggestions are listed below, or refer to What is Grafana? for a general overview of Grafana features.
All users
All users might want to learn about:
Admins
Administrators might want to learn about:
Package details
- Installs binary to
/usr/sbin/grafana-server
- Installs Init.d script to
/etc/init.d/grafana-server
- Creates default file (environment vars) to
/etc/default/grafana-server
- Installs configuration file to
/etc/grafana/grafana.ini
- Installs systemd service (if systemd is available) name
grafana-server.service
- The default configuration sets the log file at
/var/log/grafana/grafana.log
- The default configuration specifies an sqlite3 db at
/var/lib/grafana/grafana.db
- Installs HTML/JS/CSS and other Grafana files at
/usr/share/grafana
标签:Grafana,sudo,apt,手册,deb,grafana,安装,server 来源: https://www.cnblogs.com/cscshi/p/16582774.html