我必须为Grafana创建一个插件。为此,我从Github克隆了代码,并遵循了this。我设法建立了grafana,但是在运行服务器时遇到了问题。我遇到错误
Grafana-server Init Failed: Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath
我确实在issue找到了这个问题。我已经复制了“ 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"
但是他们中没有一个成功。我仍然遇到错误
Grafana-server Init Failed: Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath
我在做什么错?我是Grafana开发的新手,任何帮助将不胜感激。
答案 0 :(得分:1)
我设法解决了这个问题。我通过使用以下命令在本地运行Grafana
./grafana-server.exe -config "D:\Go-UpdatedWorkSpace\grafana\conf\custom.ini" -homepath "D:\Go-UpdatedWorkSpace\grafana".
我在用GoLang构建grafana之后在创建的“ bin”文件夹上执行了此命令。 (homepath目录中还有一个bin文件夹,我认为我们可以使用任何“ bin”文件夹)。问题是我没有在命令中提供“ homepath”。 “ homepath”是克隆grafana代码的目录。
答案 1 :(得分:0)
如果有人在寻找 Mac,下面的方法有效。我尝试使用 grafana 版本 8.x 。对于默认安装,不需要提供 -config 作为 -homepath 应该注意。这可以从任何位置运行。
/grafana-install-path/bin/grafana-server -homepath /grafana-install-path web