streamthoughts / kafka-monitoring-stack-docker-compose

This project provides Docker compose files to deploy an Apache Kafka platform with a monitoring stack using Prometheus and Grafana
Apache License 2.0
134 stars 75 forks source link

Issue with javaagent #4

Open Prosecutor22 opened 1 year ago

Prosecutor22 commented 1 year ago

I have issue with docker that: broker | Error opening zip file or JAR manifest missing : /usr/share/jmx-exporter/jmx_prometheus_javaagent-0.20.0.jar broker | Error occurred during initialization of VM broker | agent library failed to init: instrument

And here is my docker compose file for broker container: broker: image: confluentinc/cp-kafka:7.5.0 hostname: broker container_name: broker ports: - "9092:9092" - "9101:9101" volumes: - ./jmx-exporter:/usr/share/jmx_exporter environment: KAFKA_NODE_ID: 1 KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT' KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092' KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker:29092 KAFKA_JMX_PORT: 9101 KAFKA_PROCESS_ROLES: 'broker,controller' KAFKA_CONTROLLER_QUORUM_VOTERS: '1@broker:29093' KAFKA_LISTENERS: 'PLAINTEXT://broker:29092,CONTROLLER://broker:29093,PLAINTEXT_HOST://0.0.0.0:9092' KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT' KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER' KAFKA_LOG_DIRS: '/tmp/kraft-combined-logs' CLUSTER_ID: 'MkU3OEVBNTcwNTJENDM2Qk' EXTRA_ARGS: -javaagent:/usr/share/jmx-exporter/jmx_prometheus_javaagent-0.20.0.jar=1234:/usr/share/jmx-exporter/zookeeper.yml -javaagent:/usr/share/jmx-exporter/jolokia-jvm-1.7.1.jar=port=1235,host=* -Djava.util.logging.config.file=/usr/share/jmx-exporter/exporter_debug_logging.properties

I have research a few days but can not fix the issue, can anybody help me? Thank you

CodeWithAdarsha commented 9 months ago

Try this and make sure you place java agent jar at right place and provide read & write access for that.

and the path it should be /usr/app not "/usr/share/"

EXTRA_ARGS: -javaagent:/usr/app/jmx_prometheus_javaagent.jar=7071:/usr/app/prom-jmx-agent-config.yml

KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=192.168.65.0 # YOUR DOCKER NETWORK IP -Dcom.sun.management.jmxremote.rmi.port=9998 # Open this PORT in docker port section

` volumes: