grafana_mysql安装
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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)