[root@grafana ~]# cd /usr/local/grafana/conf [root@grafana conf]# vim default.ini [paths] # Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used) # 临时文件和会话信息的存储位置。使用 sqlite 作为存储结构时数据库的存储位置。 data = /data/grafana # Temporary files in `data` directory older than given duration will be removed temp_data_lifetime = 24h # Directory where grafana can store logs # 日志路径,存储 Grafana 的日志的位置 logs = /data/logs/grafana # Directory where grafana will automatically scan and look for plugins # 指定 grafana 插件的存储路径。 plugins = data/plugins
[root@grafana conf]# vim default.ini [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 property. # 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 = xFTO8AE8RikpTIwb # Use either URL or the previous fields to configure the database # Example: mysql://user:secret@host:port/database url = mysql://root:xFTO8AE8RikpTIwb@127.0.0.1:3306/grafana # Max idle conn setting default is 2 max_idle_conn = 2 # Max conn setting default is 0 (mean not set) max_open_conn = # Connection Max Lifetime default is 14400 (means 14400 seconds or 4 hours) conn_max_lifetime = 14400 # Set to true to log the sql calls and execution times. log_queries = # For "postgres", use either "disable", "require" or "verify-full" # For "mysql", use either "true", "false", or "skip-verify". ssl_mode = disable # Database drivers may support different transaction isolation levels. # Currently, only "mysql" driver supports isolation levels. # If the value is empty - driver's default isolation level is applied. # For "mysql" use "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ" or "SERIALIZABLE". isolation_level = ca_cert_path = client_key_path = client_cert_path = server_cert_name = # For "sqlite3" only, path relative to data_path setting path = grafana.db # For "sqlite3" only. cache mode setting used for connecting to the database cache_mode = private