修改配置文件
在postgres数据库中创建grafana
vim /etc/grafana/grafana.ini
#################################### 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.
type = postgres
host = 10.6.8.227:5500
name = grafana
user = postgres
password = pgsmaster
database = grafana
#url = postgresql://postgres:pgsmaster@10.6.8.227:5500/grafana
# 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 =
# 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
启动
docker run -d -p 13000:3000 --name grafana1 -v /home/grafana/grafana.ini:/etc/grafana/grafana.ini grafana/grafana