标题 1、操作系统
ubuntu
cpu ARMx64
标题 2、部署方式,apt方式安装
标题 2.1 官方部署方式
sudo apt-get install -y adduser libfontconfig1 musl
wget https://dl.grafana.com/enterprise/release/grafana-enterprise_10.1.4_arm64.deb
sudo dpkg -i grafana-enterprise_10.1.4_arm64.deb
标题 2.2 国内资源方式
标题 2.3 配置文件地址
etc/grafana/grafana.ini
# **如果没有特殊需求,使用默认配置即可**
标题 2.4 配置文件简单注解
[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
# Directory where grafana can store logs
;logs = /var/log/grafana 日志位置
# Directory where grafana will automatically scan and look for plugins
;plugins = /var/lib/grafana/plugins 插件位置
# folder that contains provisioning config files that grafana will apply on startup and while running.
;provisioning = conf/provisioning
[server] 服务访问相关
# Protocol (http, https, h2, socket)
;protocol = http 使用协议,http,https,socket等方式
# This is the minimum TLS version allowed. By default, this value is empty. Accepted values are: TLS1.2, TLS1.3. If nothing is set TLS1.2 would be taken
;min_tls_version = "" 最低支持的tls版本
# The ip address to bind to, empty will bind to all interfaces
;http_addr = 方式地址
# The http port to use
;http_port = 3000 端口,默认3000
# 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 = %(protocol)s://%(domain)s:%(http_port)s/
# 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 https证书路径含文件
;cert_file =
;cert_key =
# Unix socket gid
# Changing the gid of a file without privileges requires that the target group is in the group of the process and that the process is the file owner
# It is recommended to set the gid as http server user gid
# Not set when the value is -1
;socket_gid =
# Unix socket mode
;socket_mode =
# Unix socket path
;socket =
# CDN Url
;cdn_url =
# Sets the maximum time using a duration format (5s/5m/5ms) before timing out read of an incoming request and closing idle connections.
# `0` means there is no timeout for reading the request.
;read_timeout = 0
# This setting enables you to specify additional headers that the server adds to HTTP(S) responses.
[server.custom_response_headers]
[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
;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 =
type = mysql
host = 127.0.0.1:3306
name = grafana
user = lisi
password = lisi
# Use either URL or the previous fields to configure the database
# Example: mysql://user:secret@host:port/database
;url = mysql url方式
# For "postgres", use either "disable", "require" or "verify-full"
# For "mysql", use either "true", "false", or "skip-verify".
;ssl_mode = disable ssl证书模式
# 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 =
开始ssl_mode模式,需要配置证书相关配置
;ca_cert_path =
;client_key_path =
;client_cert_path =
;server_cert_name =
# sqlite数据库
# 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
# For "sqlite3" only. Enable/disable Write-Ahead Logging, https://sqlite.org/wal.html. Default is false.
;wal = false
# For "mysql" only if migrationLocking feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0.
;locking_attempt_timeout_sec = 0
# For "sqlite" only. How many times to retry query in case of database is locked failures. Default is 0 (disabled).
...
...
...
标题 2.3 配置的开启和注释
ini文件的注视方式式 使用 英文 ; 注释 或者 # 开始注释
注释配置
;password =
开启配置
password =
标题 3、服务启动
systemctl start grafana-server.service
ubuntu操作系统默认已经设置了开机自启动
验证服务是否正常启动
root@xiaofeng:~# systemctl status grafana-server.service
● grafana-server.service - Grafana instance
Loaded: loaded (/lib/systemd/system/grafana-server.service; disabled; vendor preset: enabled)
Active: active (running) since Sat 2023-10-07 10:27:13 CST; 2h 29min ago
Docs: http://docs.grafana.org
Main PID: 22336 (grafana)
Tasks: 8 (limit: 4525)
Memory: 82.4M
CPU: 15.825s
CGroup: /system.slice/grafana-server.service
标题 4、访问
grafana服务默认使用的是3000端口
访问方式 http://ip:3000
默认用户名/密码
admin/admin