在kafka Connect Contruent图像上使用JMX出口商在代理加载时间上投掷NosuchfieldException
我目前正在triy to揭露kafka connect workers jmx:
使用此docker映像:
FROM cnfldemos/cp-server-connect-datagen:0.5.3-7.1.0
ADD --chown=1000:1000 exporterConfig.yml /opt/prometheus-exporter/prom-jmx-agent-config.yml
ADD --chown=1000:1000 jmx_prometheus_javaagent-0.17.0.jar /opt/prometheus-exporter/agent.jar
jmx offorter版本是最后一个来自0的jmx exporter版本,
这是连接工人开始启动时的结果日志:
PS D:\env\confluent-platform> docker logs connect -f
===> User
uid=1000(appuser) gid=1000(appuser) groups=1000(appuser)
===> Configuring ...
===> Running preflight checks ...
===> Check if Kafka is healthy ...
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.lang.NoSuchFieldError: UNKNOWN
at io.prometheus.jmx.JmxCollector$Rule.<init>(JmxCollector.java:57)
at io.prometheus.jmx.JmxCollector.loadConfig(JmxCollector.java:214)
at io.prometheus.jmx.JmxCollector.<init>(JmxCollector.java:91)
at io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:29)
... 6 more
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
this java.lang.lang.nosuchfielderror让我思考依赖关系冲突问题,
我浏览了JMX Exporter&amp;它的simpleclient 依赖项
确实,实际上是从collector.java类中的SimpleClient inum inum inum inum inum inum inm in collector.java类中仅出现在版本10之后10之后才出现,14是JMX出口商中的依赖项编号。
但是我采用了cnfldemos/cp-server-connect-datagen的源代码,但我无法找到对此依赖项软件包的任何参考。
欢迎任何建议!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您检查了
您会注意到,您必须设置以下环境变量才能启用JMX
您所遇到的问题,因为您指定了
kafka_jmx_opts
,默认情况下JMX身份验证是已启用
。为了禁用它,它使用此标志-dcom.sun.management.jmxremote.authenticate = false
我通过以下配置解决了此问题:
If you check the source code of the
confluent kafka-connect images
You will notice that, you have to set the following environment variables to enable JMX
The issue you are facing is because when you specify the
KAFKA_JMX_OPTS
, by default the jmx authentication isenabled
. To disable it use this flag-Dcom.sun.management.jmxremote.authenticate=false
I resolved this issue with following configuration: