JMX Exporter&Jenkins-地址已在使用中错误

时间:2018-10-26 15:58:50

标签: jenkins jmx-exporter

我已经成功地使用JMX Exporter监视Java应用程序,例如Bitbucket。但是,我无法使其与Jenkins应用程序一起使用。我总是收到绑定错误:地址已在使用中。 这是我的JMX Exporter config.yml。

---
startDelaySeconds: 0
jmxUrl: service:jmx:rmi:///jndi/rmi://127.0.0.1:9010/jmxrmi
ssl: false
lowercaseOutputName: false
lowercaseOutputLabelNames: false
rules:
  - pattern: '.*'

这是启动命令:

/etc/alternatives/java \
    -javaagent:/opt/prometheus/jmx_prometheus_javaagent-0.10.jar=9011:/opt/prometheus/config.yml \
    -Dcom.sun.management.jmxremote \
    -Dcom.sun.management.jmxremote.ssl=false \
    -Dcom.sun.management.jmxremote.authenticate=false \
    -Dcom.sun.management.jmxremote.port=9010 \
    -Dcom.sun.akuma.Daemon=daemonized \
    -Djava.net.preferIPv4Stack=true \
    -Dhudson.plugins.active_directory.ActiveDirectorySecurityRealm.forceLdaps=true \
    -Dpermissive-script-security.enabled=true \
    -DJENKINS_HOME=/var/lib/jenkins \
    --logfile=/var/log/jenkins/jenkins.log \
    --webroot=/var/cache/jenkins/war \
    --daemon --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20 --prefix= \
    -jar /usr/lib/jenkins/jenkins.war 

错误

[root@ci-dev-rhel6-03 rcallahan]# service jenkins start
Starting Jenkins Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at sun.net.httpserver.ServerImpl.bind(ServerImpl.java:133)
    at sun.net.httpserver.HttpServerImpl.bind(HttpServerImpl.java:54)
    at io.prometheus.jmx.shaded.io.prometheus.client.exporter.HTTPServer.<init>(HTTPServer.java:83)
    at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:38)
    ... 6 more
                                                       [  OK  ]

我无法找到有关此特定用例的任何帮助。任何帮助将不胜感激。

谢谢, 罗布

0 个答案:

没有答案