Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
363 views
in Technique[技术] by (71.8m points)

openshift - SonarQube: Change the elastic search client host

In brief: Is there a way of changing the target address within the elastic search client used by SonarQube?

More Info: I'd love to use SonarQube > 4.1 on OpenShift. Unfortunately, you can't bind to localhost in that environment. So 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 we'll also have the elastic search server that tries to bind to localhost, which leads to a crash at startup. But there's no such thing as a sonar.search.host property (similar to sonar.search.port), is there?

As a workaround, changing the binding of the server can be changed using the sonar.search.javaAdditionalOpts and es.network.host parameters. Yeah I know, I shouldn't be doing this. Because now the app crashes with a NoNodeAvailableException: No node available. That's why I'm looking for a way to change this.
Looking at SonarQubes source code, I presume that the client's target address is hard-coded. (I might have gotten that wrong, though)

I presume without a solution for this, we'll never SonarQube 5.0 running on OpenShift or any other environment with strict security policy.

Can anyone think of another workaround?
Maybe changing Java's definition for "localhost"/loopback interface? However, changing /etc/hosts doesn't work without root access. Any other ideas?

Edit: If you want to have a look yourself here's how far I got so far. The build file is the essential part.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is possible since SonarQube 5.2, using the sonar.search.host property.
For an example on how to deploy this on OpenShift, see here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...