wget https://dl.grafana.com/oss/release/grafana-6.2.0-1.x86_64.rpm
sudo yum localinstall grafana-6.2.0-1.x86_64.rpm
# 开通防火墙默认3000端口
firewall-cmd --add-port=3000/tcp --permanent
firewall-cmd --reload
启动grafana,并设置开机启动
systemctl daemon-reload
systemctl start grafana-server
systemctl status grafana-server
systemctl enable grafana-server.service
替换默认的数据库为mysql数据库
创建数据库
CREATE DATABASE IF NOT EXISTS grafana DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
创建用户
create user grafana@'%' IDENTIFIED by 'grafana';
授权
grant all privileges on grafana.* to grafana@localhost identified by 'grafana';
刷新权限表
flush privileges;
# 修改配置文件
vi /etc/grafana/grafana.ini
[database]
type = mysql
host = 127.0.0.1:3306
name = grafana
user = grafana
password =grafana
url = mysql://grafana:grafana@localhost:3306/grafana
# Grafana v6.2之后移除了[session] 改用 remote_cache 请自行修改配置
#重启服务
systemctl restart grafana-server.service
参考连接:
https://grafana.com/docs/installation/configuration/
https://grafana.com/docs/installation/configuration/#remote-cache
https://grafana.com/plugins/radensolutions-netxms-datasource/installation
网友评论