简体   繁体   English

使用 JMX 在 Kafka 上无法读取我的生产者和消费者

[英]my producer and consumer are not readable on Kafka using JMX

I set the Kafka on my localhost and then read the broker side using JVM and port 1999 but whatever I tried I can't reach my consumer or producer.我在我的本地主机上设置了 Kafka,然后使用 JVM 和端口 1999 读取代理端,但无论我尝试什么,我都无法联系到我的消费者或生产者。 I am able to connect to port 9092 and read MBean on jconsole but I can't send any query to it using the python subprocess我能够连接到端口 9092 并在 jconsole 上读取 MBean,但我无法使用 python 子进程向它发送任何查询

I used the following JVM connection example "service:jmx:rmi:///jndi/rmi://localhost:1999/jmxrmi" and jmxquery/subprocess python libraries.我使用了以下 JVM 连接示例“service:jmx:rmi:///jndi/rmi://localhost:1999/jmxrmi”和 jmxquery/subprocess python 库。

I wrote down every step I am doing in the repository我在存储库中写下了我正在做的每一步

I am starting Kafka like this:我是这样开始卡夫卡的:

and starting consumers like this:并像这样开始消费者:

also the producer:还有制作人:

This is the main worker that I am trying to make work:这是我要努力工作的主要工人:

more info about what I am trying to accomplish is here: https://github.com/mirkan1/kafka_monitoring/tree/master/Kafka_Complete_Monitoring有关我要完成的工作的更多信息在这里: https ://github.com/mirkan1/kafka_monitoring/tree/master/Kafka_Complete_Monitoring

I found the problem was that I was using the same port which is 9092 for everything, after I assigned different ports for consumer and producer it worked at intended and I was able to read MBeans data using JMX connection我发现问题是我对所有东西都使用了 9092 的同一个端口,在我为消费者和生产者分配了不同的端口之后它按预期工作并且我能够使用 JMX 连接读取 MBean 数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM