【发布时间】:2016-10-03 20:07:10
【问题描述】:
简而言之:有没有办法配置management-agent.jar 使用的所有端口(在SonarQube 5.5 中引入)甚至禁用它?
更多信息:我正在尝试在 OpenShift (again) 上运行 SonarQube,这次是版本 5.5/5.6。
启动时出现以下错误:Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 0; nested exception is: java.net.BindException: Permission denied.
到目前为止我发现的是
- the agent opens three ports,
- 可以配置两个(系统属性
com.sun.management.jmxremote.port和com.sun.management.jmxremote.rmi.port) - 但其中之一是by design always the ephemeral port (port 0),它似乎不适用于OpenShift。
除了将端口明确设置为 OpenShift 上的允许范围(端口 15000-35530)外,我还尝试了 -XX:+DisableAttachMechanism 选项,但没有成功。
任何想法如何解决这个问题? SonarQube 可以在没有代理的情况下工作吗?
如何重现:
从this 创建一个OpenShift 应用,然后将.openshift/action_hooks/build 中的SONAR_VERSION 更改为5.5 或5.6
完整的堆栈跟踪
2016.06.02 16:09:34 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[es]: java -Djava.awt.headless=true -javaagent:jre/lib/management-agent.jar -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 0; nested exception is:
java.net.BindException: Permission denied
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:384)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:397)
Caused by: java.lang.RuntimeException: Exception thrown by the agent
at sun.management.Agent.error(Agent.java:520)
at sun.management.Agent.error(Agent.java:511)
at sun.management.Agent.startAgent(Agent.java:268)
at sun.management.Agent.agentmain(Agent.java:134)
at sun.management.Agent.premain(Agent.java:116)
... 6 more
【问题讨论】:
标签: sonarqube sonarqube-ops sonarqube-5.5 sonarqube5.6