grafana配置mysql_grafana配置与简单使用

一篇关于grafana使用与原理的调研文档,点击下载。

正文

以下内容由word文档直接导入,虽然排版差劲一点,但是可以方便大家可以在线查阅。

Grafana配置与简单使用

下面简单记录一下grafana的使用流程。

安装

选择对应的平台,走wget下载二进制即可,别着急启动。

配置文件

解压后,conf目录下defaults.ini是默认配置文件,sample.ini是自定义配置,grafana启动时候需要-config指定加载sample.ini文件,并且会自动load同目录下的defaults.ini作为默认参数,千万不能删除defaults.ini,否则无法启动grafana。

database数据库

我改了一下数据库,grafana所有的配置都会存在数据库里,我用mysql:

[database]

# You can configure the database connection by specifying type, host, name, user and password

# as separate properties or as on string using the url properties.

# Either “mysql”, “postgres” or “sqlite3”, it’s your choice

type = mysql

host = 127.0.0.1:3306

name = grafana

user = root

# If the password contains # or ; you have to wrap it with triple quotes. Ex “””#password;”””

password = xxxxxyyyyy

注意,数据库提前建好:

create database grafana

数据表的话grafana会自动创建出来,Golang的ORM库大多这个风格。

Session登录会话

为了可以部署grafana集群,需要让session存在redis里共享:

[session]

# Either “memory”, “file”, “redis”, “mysql”, “postgres”, default is “file”

provider = redis

# Provider config options

# memory: not have any config yet

# file: session dir path, is relative to grafana data_path

# redis: config like redis server e.g. addr=127.0.0.1:6379,pool_size=100,db=grafana

# mysql: go-sql-driver/mysql dsn config string, e.g. user:password@tcp(127.0.0.1:3306)/database_name

# postgres: user=a password=b host=localhost port=5432 dbname=c sslmode=disable

provider_config = addr=127.0.0.1:6379,pool_size=100,db=grafana

简单配置一下就行。

Security安全

[security]

# default admin user, created on startup

admin_user = admin

# default admin password, can be changed before first start of grafana, or in profile settings

admin_password = admin

默认管理员是admin,admin,也可以登录后修改,届时帐号密码就保存到mysql里了。

认证系统

支持基于数据库的用户系统,或者LDAP,以及github等第三方登录。

默认走数据库。

Ldap相关的:

#################################### Auth LDAP ##########################

[auth.ldap]

;enabled = false

;config_file = /e

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值