Hi everyone, I’m encountering an issue while runn...
# troubleshooting
s
Hi everyone, I’m encountering an issue while running the Pinot controller with JMX exporter configurations in JAVA_OPTS:
Copy code
env:
  - 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:
Copy code
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!
m
Do you know why that port is already in use? Are you running something outside of Pinot there? or is it interfering with other pinot components' jmx exporter?
s
I used different ports but still the same issue. I saw a similar issue in Github - https://github.com/apache/pinot/issues/11891
m
Hmm, if you use different port, it still complains about 8008? Or the new one you used?
And what version of Pinot are you running?
s
Pinot Version - 1.1.0 New one used, not 8008.
m
s
Yes, that works, if I override JAVA_OPTS without prometheus configs it will work. This only happens when there is prometheus configs in JAVA_OPTS
m
Are you sure nothing else is running in that pod? If you start multiple Pinot components on the same pod, their jmx port will conflict right?
s
Each pinot component runs in its own pod. I tested with different ports like 8008, 18080, 29076 etc. but the issue doesn't seem to be port-related. Adding Prometheus configurations works, I see the metrics in the Prometheus. The issue arises when I run the table creation. I think at that point it is using the same port assigned to the Prometheus.
m
Oh I see.
You shouldn't need to specify prometheus config for table creation
Any reason why you want to?
x
if you run any pinot command inside the pod container, you need to add
export JAVA_OPTS=""
to override env variable
I feel we could separate the startup command to avoid this issue
right now all the commands are using
pinot-admin.sh
we can try to separate them using
pinot-tools.sh
`pinot-starter.sh`etc to avoid this issue
s
Understood. So there is no other way to handle this? Like a different approach to configure the JMX Exporter for sending metrics to Prometheus so it doesn't conflict with the pinot commands inside the pod?
m
I think the issue is Pinot admin is used for starting components (that should initialize jmx), but also to do operations like table creation (that should not initialize).
Note though, all the operations are ultimately test apis and don’t need to use Pinot admin, if you are really bothered about it you can just use the apis
x
true ,you can use swagger api to create table
s
Thank you so much guys for your help!!! 😊