3

我正在尝试在 openshift 实例中安装最新版本的声纳,当搜索尝试开始时,它尝试绑定到 0.0.0.0:9001 但 openshift 不允许绑定到所有接口,所以我必须设置 ip,我可以在配置中的哪个位置设置此属性?

我已经为这样的绑定配置了声纳 ip

# Binding IP address. For servers with more than one IP address, this property specifies which
# address will be used for listening on the specified ports.
# By default, ports will be used on all IP addresses associated with the server.
sonar.web.host=${env:OPENSHIFT_DIY_IP}

提前致谢

[编辑]

我已经更改了配置文件,以便它直接分配ip,但仍然有同样的错误,是它忽略了设置吗?

2015.01.13 20:09:47 WARN  sea[o.s.p.ProcessEntryPoint]  Starting search
2015.01.13 20:09:47 INFO  sea[o.s.s.SearchServer]  Starting ES[sonarqube] on port: 15000
2015.01.13 20:09:47 INFO  sea[o.elasticsearch.node]  [sonar-1421197785954] version[1.1.2], pid[286110], build[e511f7b/2014-05-22T12:27:39Z]
2015.01.13 20:09:47 INFO  sea[o.elasticsearch.node]  [sonar-1421197785954] initializing ...
2015.01.13 20:09:47 INFO  sea[o.e.plugins]  [sonar-1421197785954] loaded [], sites []
2015.01.13 20:09:51 INFO  sea[o.elasticsearch.node]  [sonar-1421197785954] initialized
2015.01.13 20:09:51 INFO  sea[o.elasticsearch.node]  [sonar-1421197785954] starting ...
2015.01.13 20:09:52 WARN  sea[o.s.p.ProcessEntryPoint]  Fail to start search
org.elasticsearch.transport.BindTransportException: Failed to bind to [15000]
    at org.elasticsearch.transport.netty.NettyTransport.doStart(NettyTransport.java:381) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.transport.TransportService.doStart(TransportService.java:92) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.node.internal.InternalNode.start(InternalNode.java:229) ~[elasticsearch-1.1.2.jar:na]
    at org.sonar.search.SearchServer.start(SearchServer.java:135) [sonar-search-4.5.2.jar:na]
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:77) ~[sonar-process-4.5.2.jar:na]
    at org.sonar.search.SearchServer.main(SearchServer.java:261) [sonar-search-4.5.2.jar:na]
Caused by: org.elasticsearch.common.netty.channel.ChannelException: Failed to bind to: 0.0.0.0/0.0.0.0:15000
    at org.elasticsearch.common.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.transport.netty.NettyTransport$3.onPortNumber(NettyTransport.java:372) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.common.transport.PortsRange.iterate(PortsRange.java:58) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.transport.netty.NettyTransport.doStart(NettyTransport.java:368) ~[elasticsearch-1.1.2.jar:na]
    ... 7 common frames omitted
java.net.SocketException: Permiso denegado
    at sun.nio.ch.Net.bind0(Native Method) ~[na:1.7.0_71]
    at sun.nio.ch.Net.bind(Net.java:444) ~[na:1.7.0_71]
    at sun.nio.ch.Net.bind(Net.java:436) ~[na:1.7.0_71]
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) ~[na:1.7.0_71]
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.7.0_71]
    at org.elasticsearch.common.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:372) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:296) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.common.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) ~[elasticsearch-1.1.2.jar:na]
    at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) ~[elasticsearch-1.1.2.jar:na]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0_71]
    at java.lang.Thread.run(Thread.java:745) ~[na:1.7.0_71]
4

2 回答 2

1

${env:OPENSHIFT_DIY_IP}不起作用,因为尚未处理环境变量。

请查看并投票给http://jira.codehaus.org/browse/SONAR-3682

于 2015-01-13T12:23:05.417 回答
0

您可以像这些人那样替换构建脚本中的变量。
通过将其添加到您的构建中,可以避免您编辑的问题

# Adapt elasticsearch host
sed -i "s/^#sonar.search.javaAdditionalOpts=.*$/sonar.search.javaAdditionalOpts=-Des.network.host=$OPENSHIFT_DIY_IP/" sonar.properties
# Adapt elasticsearch host to be in permitted range 15000-35530 for openshift, as specified here: https://help.openshift.com/hc/en-us/articles/202185874
sed -i "s/^#sonar.search.port=.*$/sonar.search.port=35530/" sonar.properties

但你最终会得到一个. 我在这里问了一个更具体的问题。希望有人提出如何解决这个问题的想法。NoNodeAvailableException: No node available

于 2015-02-18T21:36:22.957 回答