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

Issue with javaagent #4

Open
Prosecutor22 opened this issue Sep 21, 2023 · 1 comment
Open

Issue with javaagent #4

Prosecutor22 opened this issue Sep 21, 2023 · 1 comment

Comments

@Prosecutor22
Copy link

Prosecutor22 commented Sep 21, 2023

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
Copy link

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: - ./jmx:/usr/app # Make sure you place jar at right place

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

2 participants