无法在本地系统上运行 Grafana 服务器

Wal*_*eed 5 grafana

我必须为 Grafana 创建一个插件。为此,我从 Github 克隆了代码并遵循了这个。我已经成功构建了grafana,但在运行服务器时遇到了问题。我收到错误

Grafana-server Init Failed: Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath
Run Code Online (Sandbox Code Playgroud)

我确实发现了这个问题。我复制了“sample.ini”并将其重命名为“custom.ini”,并在构建 grafana 后创建的 bin 文件夹中使用了以下命令

.\grafana-server.exe --config D:\Go-UpdatedWorkSpace\grafana\conf\custom.ini

.\grafana-server.exe D:\Go-UpdatedWorkSpace\grafana\conf\custom.ini

.\grafana-server.exe -config D:\Go-UpdatedWorkSpace\grafana\conf\custom.ini

.\grafana-server.exe -config "D:\Go-UpdatedWorkSpace\grafana\conf\custom.ini"

.\grafana-server.exe --config "D:\Go-UpdatedWorkSpace\grafana\conf\custom.ini"

.\grafana-server.exe "D:\Go-UpdatedWorkSpace\grafana\conf\custom.ini"
Run Code Online (Sandbox Code Playgroud)

但他们都不起作用。我仍然收到错误

Grafana-server Init Failed: Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么 ?我是 Grafana 开发的新手,任何帮助将不胜感激。

Wal*_*eed 8

我已经设法解决了这个问题。我使用以下命令在本地运行 Grafana

 ./grafana-server.exe -config "D:\Go-UpdatedWorkSpace\grafana\conf\defaults.ini" -homepath "D:\Go-UpdatedWorkSpace\grafana".
Run Code Online (Sandbox Code Playgroud)

我在使用 GoLang 构建 grafana 后创建的“bin”文件夹上执行了此命令。(homepath 目录中还有一个 bin 文件夹,我想我们可以使用任何“bin”文件夹)。问题是我没有在命令中提供“homepath”。“homepath”是grafana代码克隆的目录。