SP
12/05/2024, 6:42 PMenv:
- name: JAVA_OPTS
value: "-XX:ActiveProcessorCount=2 -Xms256M -Xmx1G -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xlog:gc*:file=/opt/pinot/gc-pinot-controller.log -Dlog4j2.configurationFile={{ .Values.controller.log4j2ConfFile }} -Dplugins.dir={{ .Values.controller.pluginsDir}} -javaagent:/opt/pinot/etc/jmx_prometheus_javaagent/jmx_prometheus_javaagent-0.18.0.jar=8008:/opt/pinot/etc/jmx_prometheus_javaagent/configs/pinot.yml"
I’m getting the following error:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
Caused by: java.net.BindException: Address already in use
at java.base/sun.nio.ch.Net.bind0(Native Method)
at java.base/sun.nio.ch.Net.bind(Net.java:459)
at java.base/sun.nio.ch.Net.bind(Net.java:448)
at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:80)
at jdk.httpserver/sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:142)
at jdk.httpserver/sun.net.httpserver.HttpServerImpl.<init>(HttpServerImpl.java:50)
at jdk.httpserver/sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:35)
at jdk.httpserver/com.sun.net.httpserver.HttpServer.create(HttpServer.java:137)
at io.prometheus.jmx.shaded.io.prometheus.client.exporter.HTTPServer.<init>(HTTPServer.java:396)
at io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:31)
... 6 more
It appears that the javaagent JMX Exporter is unable to bind to port 8008 because the address is already in use. I’ve seen suggestions about overriding JAVA_OPTS when table creation, but I was wondering:
1. Is there a better way to handle this issue?
2. Is there a better approach to configure the JMX Exporter for sending metrics to Prometheus in a Kubernetes-based Pinot setup?
I have also used jvmOpts/JVM_OPTS but no luck.
Any advice or examples from similar setups would be much appreciated. Thanks in advance!Mayank
SP
12/05/2024, 10:24 PMMayank
Mayank
SP
12/05/2024, 10:29 PMMayank
SP
12/05/2024, 10:37 PMMayank
SP
12/05/2024, 11:00 PMMayank
Mayank
Mayank
Xiang Fu
export JAVA_OPTS="" to override env variableXiang Fu
Xiang Fu
pinot-admin.shXiang Fu
pinot-tools.sh `pinot-starter.sh`etc to avoid this issueSP
12/05/2024, 11:08 PMMayank
Mayank
Xiang Fu
SP
12/06/2024, 5:48 AM