一、 环境介绍
- Grafana版本:grafana-5.0.3-1.x86_64
- 系统版本:centos(6/7)
- rpm包下载地址(百度云):链接:https://pan.baidu.com/s/17gzqV4GZWQKSD-dre73N1A 密码:62ur
- tar包下载地址(百度云):链接:https://pan.baidu.com/s/10s4rVJGSYwMeszrNoOMOWg 密码:sgg8
- Github地址:https://github.com/grafana/grafana (用于下载其他版本)
- 官网地址:https://grafana.com
- 官网文档地址:http://docs.grafana.org/
- 下载地址:
•https://grafana.com/grafana/download
•https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.0.3.linux-x64.tar.gz
•https://packagecloud.io/grafana/stable/packages/el/6/grafana-5.0.3-1.x86_64.rpm/download.rpm(centos6,rpm安装地址)
二、 安装grafana(使用rpm安装)
1、rpm安装
[root@cxm ~]#
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.0.3-1.x86_64.rpm
[root@cxm ~]# yum -y install initscripts fontconfig
[root@cxm ~]# rpm -Uvh grafana-5.0.4-1.x86_64.rpm
如出现报错:
warning: grafana-5.0.3-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 24098cb6: NOKEY
error: Failed dependencies:
urw-fonts is needed by grafana-5.0.3-1.x86_64
[root@cxm ~]# rpm -ivh grafana-5.0.4-1.x86_64.rpm
warning: grafana-5.0.4-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 24098cb6: NOKEY
error: Failed dependencies:
urw-fonts is needed by grafana-5.0.4-1.x86_64
解决:
[root@cxm ~]# yum install -y urw-fonts
之后执行
[root@cxm ~]# rpm -Uvh grafana-5.0.4-1.x86_64.rpm
2、yum存储库安装
将以下内容添加到新的文件中 /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://packagecloud.io/grafana/stable/el/7/$basearch (根据实际情况写)
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
如果您想要测试版或候选版,还有一个测试存储库。
baseurl=https://packagecloud.io/grafana/testing/el/7/$basearch
然后通过yum命令安装Grafana 。
[root@cxm ~]# yum install grafana
三、 简单使用
1、 centos6
[root@cxm ~]#service grafana-server start
[root@cxm ~]#service grafana-server restart
[root@cxm ~]#service grafana-server status
[root@cxm ~]#/sbin/chkconfig --add grafana-server
2、 centos7
[root@cxm ~]#systemctl daemon-reload
[root@cxm ~]#systemctl start grafana-server
[root@cxm ~]#systemctl stop grafana-server
[root@cxm ~]#systemctl restart grafana-server
[root@cxm ~]#systemctl status grafana-server
四、 相关文件位置
1、 访问地址
IP:3000
2、 账号密码
admin/admin
3、 环境文件
/etc/sysconfig/grafana-server
4、 日志文件
/var/log/grafana
5、 数据库
/var/lib/grafana/grafana.db
6、 配置文件
/etc/grafana/grafana.ini
五、 相关问题
1、修改密码:(数据添加完成请谨慎操作)
2、修改端口
可以直接修改配置文件
[root@cxm ~]# vim /etc/grafana/grafana.ini
http_port = 30000
1、 添加用户