Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JMX Exporter - Address in use #164

Open
elizagomes opened this issue Oct 26, 2020 · 0 comments
Open

JMX Exporter - Address in use #164

elizagomes opened this issue Oct 26, 2020 · 0 comments

Comments

@elizagomes
Copy link

Dear all,

I am trying to install JMX-Exporter and Prometheus to measure the kafka performance but return an error and kafka broker is not started. Follow my implementation.

Docker-compose:

kafka:
image: "landoop/fast-data-dev:latest"
restart: on-failure
environment:
- SAMPLEDATA=0
- HOSTNAME=kafka
- ADV_HOST=kafka
- KAFKA_ADVERTISED_HOST_NAME=kafka
- KAFKA_ADVERTISED_PORT=9092
- KAFKA_DELETE_TOPIC_ENABLE=true
- JMX_PORT=9581
- KAFKA_JMX_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -javaagent:/usr/app/jmx_prometheus_javaagent.jar=7071:/usr/app/prometheus-config.yml
- DEBUG=1 # set to 1 for more logging
- RUNTESTS=1 # set to 1 to run coyote test suite on startup
- ENABLE_SSL=0 # set to 1 to generate a CA, key-certificate pairs and enable a SSL port on the broker
extra_hosts:
- "kafka:127.0.0.1"
ports:
- "3030:3030" # website
- "8081:8081" # schema registry
- "8082:8082" # kafka rest
- "8083:8083" # kafka connect
- "9092:9092" # kafka broker & streams
- "2181:2181" # zookeeper
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8083"]
interval: 5s
start_period: 15s
volumes:
- ./docker/jmx-exporter1/:/usr/app/

prometheus:
image: prom/prometheus:latest
ports:
- 9090:9090/tcp
volumes:
- ./docker/mount/prometheus:/etc/prometheus/
command:
- "--config.file=/etc/prometheus/prometheus.yaml"
depends_on:
- kafka

Broker Error:

imok
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 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:220)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:85)
at sun.net.httpserver.ServerImpl.(ServerImpl.java:100)
at sun.net.httpserver.HttpServerImpl.(HttpServerImpl.java:50)
at sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:35)
at com.sun.net.httpserver.HttpServer.create(HttpServer.java:130)
at io.prometheus.jmx.shaded.io.prometheus.client.exporter.HTTPServer.(HTTPServer.java:176)
at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:31)
... 6 more
FATAL ERROR in native method: processing of -javaagent failed

Could you help me?
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant