Grafana Configuration 參數詳解(1)


---恢復內容開始---

  Granfana Configuration 配置文件grafana.ini包含很多選項,可對其進行調整,調整后重啟grafana服務方可生效。

Paths配置段

#################################### Paths ####################################
[paths]
# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
;data = /var/lib/grafana    # 默認存放數據位置

# Temporary files in `data` directory older than given duration will be removed
;temp_data_lifetime = 24h
# 刪除 'data'目錄給定時間前的臨時文件,使用0則不刪除臨時文件,時間格式h,m。如168h,30m,10h30m
# Directory where grafana can store logs ;logs
= /var/log/grafana # grafana存儲日志的目錄 # Directory where grafana will automatically scan and look for plugins ;plugins = /var/lib/grafana/plugins # grafana存放插件的目錄 # folder that contains provisioning config files that grafana will apply on startup and while running. ;provisioning = conf/provisioning

Server配置段

#################################### Server ####################################
[server]
# Protocol (http, https, socket)
;protocol = http

# The ip address to bind to, empty will bind to all interfaces
;http_addr =         # 綁定ip地址,空及綁定所有ip地址

# The http port  to use
;http_port = 3000    # 使用端口,若要調整為使用80端口,需要執行如下命令:$ sudo setcap 'cap_net_bind_service=+ep' /usr/sbin/grafana-server
             或是可以使用nginx或是apache所做前端服務器,將請求代理給grafana。
# The public facing domain name used to access grafana from a browser ;domain = localhost # Redirect to correct domain if host header does not match domain # Prevents DNS rebinding attacks ;enforce_domain = false # The full public facing url you use in browser, used for redirects and emails # If you use reverse proxy and sub path specify full url (with sub path) ;root_url = http://localhost:3000 # Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons. ;serve_from_sub_path = false # Log web requests ;router_logging = false # the path relative working path ;static_root_path = public # enable gzip ;enable_gzip = false # https certs & key file ;cert_file = ;cert_key = # Unix socket path ;socket =

 Database配置段

#################################### Database ####################################
[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 = sqlite3               # 默認使用sqlite3作為grafana數據存儲
;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 =          #如果密碼包含#或;需要使用三引號括起來如"""#password;"""

# Use either URL or the previous fields to configure the database # Example: mysql://user:secret@host:port/database ;url = # For "postgres" only, either "disable", "require" or "verify-full" ;ssl_mode = disable # For "sqlite3" only, path relative to data_path setting ;path = grafana.db # 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 "sqlite3" only. cache mode setting used for connecting to the database. (private, shared) ;cache_mode = private

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM