简体   繁体   English

Kafka + Kubernetes + Helm + `/usr/bin/kafka-avro-console-consumer`?

[英]Kafka + Kubernetes + Helm + `/usr/bin/kafka-avro-console-consumer`?

How do I use the standard kafka-avro-console-consumer tool with Kafka running via the Confluent Helm Charts?我如何使用标准的kafka-avro-console-consumer工具和通过 Confluent Helm Charts 运行的 Kafka? The confluentinc/cp-kafka:5.0.0 image recommended for running cli utilities doesn't contain kafka-avro-console-consumer .推荐用于运行 cli 实用程序的confluentinc/cp-kafka:5.0.0映像不包含kafka-avro-console-consumer

If I shell into the schema-registry pod to use kafka-avro-console-consumer如果我进入 schema-registry pod 以使用kafka-avro-console-consumer

kubectl exec -it my-confluent-oss-cp-schema-registry-6c8546c86d-pjpmd -- /bin/bash

/usr/bin/kafka-avro-console-consumer --bootstrap-server my-confluent-oss-cp-kafka:9092 --topic my-test-avro-records --from-beginning

Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 5555; nested exception is: 
    java.net.BindException: Address already in use (Bind failed)
sun.management.AgentConfigurationError: java.rmi.server.ExportException: Port already in use: 5555; nested exception is: 
    java.net.BindException: Address already in use (Bind failed)
    at sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:480)
    at sun.management.Agent.startAgent(Agent.java:262)
    at sun.management.Agent.startAgent(Agent.java:452)
Caused by: java.rmi.server.ExportException: Port already in use: 5555; nested exception is: 
    java.net.BindException: Address already in use (Bind failed)

java.rmi.server.ExportException: Port already in use: 5555; java.rmi.server.ExportException:端口已在使用中:5555;

Sounds like you've enabled JMX as part of that container via the KAFKA_JMX_PORT variable.听起来您已经通过KAFKA_JMX_PORT变量启用了 JMX 作为该容器的KAFKA_JMX_PORT

If that's the case, you will need to temporarily override that by exporting (or unset ) it within the shell session to a different value before running any other Kafka scripts如果是这种情况,您需要在运行任何其他 Kafka 脚本之前,通过在 shell 会话中将其导出(或unset )为不同的值来临时覆盖它

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

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