docker - 在 grafana 中配置多个数据源

标签 docker docker-compose grafana influxdb

我能够在为 grafana 构建 docker 容器时导入数据源和仪表板。我尝试创建两个单独的 datasource.yml 文件(例如:datasoure1.yml 和 datasource2.yml)并复制到/etc/grafana/provisioning/datasources 但得到以下错误。

lvl=warn msg="[Deprecated] the datasource provisioning config is outdated. please upgrade" logger=provisioning.datasources filename=/etc/grafana/provisioning/datasources/datasource1.yml
grafana_1_417873282a1 | t=2019-10-01T03:51:49+0000 
lvl=warn msg="[Deprecated] the datasource provisioning config is outdated. please upgrade" logger=provisioning.datasources filename=/etc/grafana/provisioning/datasources/datasource2.yml
grafana_1_417873282a1 | t=2019-10-01T03:51:49+0000 lvl=eror msg="Server shutdown" logger=server reason="Service init failed: Datasource provisioning error: datasource.yaml config is invalid. Only one datasource per organization can be marked as default"

任何提示我如何实现拥有多个数据源和仪表板?

数据源1.yml
datasources:
-  access: 'proxy'                       # make grafana perform the requests
   editable: true                        # whether it should be editable
   is_default: true                      # whether this should be the default DS
   name: 'test1'                        # name of the datasource
   org_id: 1                             # id of the organization to tie this datasource to
   type: 'influxdb'                      # type of the data source
   url: 'http://<ip-address>:8086'       # url of the prom instance
   database: 'db1'
   version: 1                            # well, versioning

数据源2.yml
datasources:
-  access: 'proxy'                       # make grafana perform the requests
   editable: true                        # whether it should be editable
   is_default: true                      # whether this should be the default DS
   name: 'test2'                        # name of the datasource
   org_id: 1                             # id of the organization to tie this datasource to
   type: 'influxdb'                      # type of the data source
   url: 'http://<ip-address>:8086'       # url of the prom instance
   database: 'db2'
   version: 1                            # well, versioning

最佳答案

您可以查看此 issue .

I have been the missing first line with the apiVersion: that has made a difference.


# # config file version
apiVersion: 1

关于docker - 在 grafana 中配置多个数据源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58177859/

相关文章:

java - 如何配置spring拦截器以在每个请求中调用

influxdb - 改变格拉法纳港口

nginx - 在 Loki 中删除部分日志

grafana - 在 Grafana 表中显示单个统计信息

docker - 我们可以在 docker 中挂载命名卷的子目录吗?

node.js - 如何扩展 NodeJS 有状态应用程序

docker-compose 将图像保存/加载到另一台主机

docker - 我应该在我的 docker-compose 文件中使用次要版本吗?

macos - docker 镜像在 macos 上物理存储在哪里?

mysql - 如何在 Docker 中设置 mysql 从机?