SonarQube:更改弹性搜索客户端主机

SonarQube: Change the elastic search client host

简述: 有没有办法在SonarQube使用的弹性搜索客户端中更改目标地址?

更多信息:我喜欢在 OpenShift 上使用 SonarQube > 4.1。不幸的是,您无法在该环境中绑定到 localhost。因此 these guys changed the service wrapper to piped mode and used the sonar.web.host property to set up SonarQube 4.0. Starting with SonarQube 4.1 我们还将拥有尝试绑定到本地主机的弹性搜索服务器,这会导致启动时崩溃。但是没有 sonar.search.host 属性(类似于 sonar.search.port)这样的东西,是吗?

作为解决方法,可以使用 sonar.search.javaAdditionalOptses.network.host 参数更改服务器的绑定。 是的,我知道,I shouldn't be doing this. Because now the app crashes with a NoNodeAvailableException: No node available。这就是为什么我正在寻找一种方法来改变它。
查看 SonarQubes source code,我推测客户端的目标地址是硬编码的。 (不过我可能弄错了)

我想如果没有解决方案,我们将永远不会在 OpenShift 或任何其他具有严格安全策略的环境中使用 SonarQube 5.0 运行。

谁能想出另一种解决方法?
也许改变 Java 对 "localhost"/loopback 接口的定义?但是,如果没有 root 访问权限,更改 /etc/hosts 是行不通的。还有其他想法吗?

编辑:如果你想自己看的话here's how far I got so far. The build file是必不可少的部分

在 Sonar 5.2 中可以设置这些属性,请参阅 here . I have tried and it works (I changed this class in Sonar 5.1 source to allow configure these ES properties, see here)。

这是可能的,因为 SonarQube 5.2, using the sonar.search.host property
有关如何在 OpenShift 上部署它的示例,请参阅 here