https://dl.grafana.com/oss/release/grafana-5.4.0-1.x86_64.rpm #官网下载安装包
[root@zbx4_0 source]# rpm -ivh grafana-5.4.0-1.x86_64.rpm
warning: grafana-5.4.0-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 24098cb6: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:grafana-5.4.0-1 ################################# [100%]
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server.service
### You can start grafana-server by executing
sudo /bin/systemctl start grafana-server.service
POSTTRANS: Running script
配置grafana主配置文件grafana.ini , 这里利用mysql数据库做数据存储
[root@zbx4_0 source]# cd /etc/grafana
[root@zbx4_0 grafana]# vim grafana.ini #http://docs.grafana.org/installation/configuration/#database
[database]
type = mysql #数据类型
host = 10.32.68.252:3306 #mysql主机:端口
name = grafana #库名
user = root #登陆用户
password = root #登陆密码
[session]
provider = mysql #会话支持的类型(有效的值memory,file,mysql,postgres,memcache或redis。 默认是file)
provider_config = root:root@tcp(10.32.68.252:3306)/grafana #取决于类型(http://docs.grafana.org/installation/configuration/#database)
cookie_name = grafana_sess #会话名称
cookie_secure = false #是否只允许https访问
session_life_time = 86400 #会话时间单位s(默认24小时)
[security]
admin_user = admin #登陆用户
admin_password = admin #登陆密码
[users]
allow_sign_up = true
allow_org_create = true
auto_assign_org = true
auto_assign_org_role = Viewer
[root@zbx4_0 grafana]#
##mysql安装略过
[root@10_32_68_252 ~]# mysql
mysql> CREATE DATABASE IF NOT EXISTS grafana default charset utf8 COLLATE utf8_general_ci;
mysql> use grafana
mysql> CREATE TABLE `session` (
`key` CHAR(16) NOT NULL,
`data` BLOB,
`expiry` INT(11) UNSIGNED NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
mysql> show tables;
+--------------------------+
| Tables_in_grafana |
+--------------------------+
| alert |
| alert_notification |
| alert_notification_state |
| annotation |
| annotation_tag |
| api_key |
| dashboard |
| dashboard_acl |
| dashboard_provisioning |
| dashboard_snapshot |
| dashboard_tag
…………………….
[root@zbx4_0 grafana]# systemctl restart grafana-server
Warning: grafana-server.service changed on disk. Run 'systemctl daemon-reload' to reload units.
登录方式 :
web : IP:3000
帐号 : admin/admin