This message was deleted.
# troubleshooting
s
This message was deleted.
k
Full Error
Copy code
2023-01-23T12:45:24,727 ERROR [main] org.apache.druid.emitter.prometheus.PrometheusEmitter - Unable to start prometheus HTTPServer
java.net.BindException: Address already in use
	at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_275]
	at sun.nio.ch.Net.bind(Net.java:461) ~[?:1.8.0_275]
	at sun.nio.ch.Net.bind(Net.java:453) ~[?:1.8.0_275]
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222) ~[?:1.8.0_275]
	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:85) ~[?:1.8.0_275]
	at sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:100) ~[?:1.8.0_275]
	at sun.net.httpserver.HttpServerImpl.<init>(HttpServerImpl.java:50) ~[?:1.8.0_275]
	at sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:35) ~[?:1.8.0_275]
	at com.sun.net.httpserver.HttpServer.create(HttpServer.java:130) ~[?:1.8.0_275]
	at io.prometheus.client.exporter.HTTPServer.<init>(HTTPServer.java:166) ~[simpleclient_httpserver-0.7.0.jar:?]
	at io.prometheus.client.exporter.HTTPServer.<init>(HTTPServer.java:180) ~[simpleclient_httpserver-0.7.0.jar:?]
	at io.prometheus.client.exporter.HTTPServer.<init>(HTTPServer.java:187) ~[simpleclient_httpserver-0.7.0.jar:?]
	at org.apache.druid.emitter.prometheus.PrometheusEmitter.start(PrometheusEmitter.java:75) [prometheus-emitter-0.23.0.jar:0.23.0]
	at org.apache.druid.java.util.emitter.service.ServiceEmitter.start(ServiceEmitter.java:61) [druid-core-0.23.0.jar:0.23.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
	at org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler.start(Lifecycle.java:446) [druid-core-0.23.0.jar:0.23.0]
	at org.apache.druid.java.util.common.lifecycle.Lifecycle.start(Lifecycle.java:341) [druid-core-0.23.0.jar:0.23.0]
	at org.apache.druid.guice.LifecycleModule$2.start(LifecycleModule.java:152) [druid-core-0.23.0.jar:0.23.0]
	at org.apache.druid.cli.GuiceRunnable.initLifecycle(GuiceRunnable.java:165) [druid-services-0.23.0.jar:0.23.0]
	at org.apache.druid.cli.CliPeon.run(CliPeon.java:306) [druid-services-0.23.0.jar:0.23.0]
	at org.apache.druid.cli.Main.main(Main.java:114) [druid-services-0.23.0.jar:0.23.0]
a
Are you sending metrics to premetheus? Has this been working? What value do you have set for druid.emitter.prometheus.port (See docs)
k
Yes, I have added this property druid.emitter.prometheus.port=8078 in common.runtime.properties. It is working, currently 3 ingestion task are running and for these 3 ingestion task automation are also running. Only two automation task are showing this exception while others are working.
s
If you are running multiple tasks in the same middle manager, each task is trying to start the prometheus emitter on the same port. This is why the recommendation is to use a prometheus gateway for the tasks. Check out the specifics here.
BTW, the only reason I can think of that some of the tasks' emitters work and others do not, is because the first task to start on each MM will grab the port, other tasks that attempt it within the same MM will fail.