如何在通过Confluent Helm Charts运行的Kafka中使用标准kafka-avro-console-consumer
工具?建议用于运行cli实用程序的confluentinc/cp-kafka:5.0.0
镜像不包含kafka-avro-console-consumer
。
如果我将 shell 注册到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;
听起来好像您已经通过
KAFKA_JMX_PORT
变量在该容器中启用了JMX。如果是这样,您将需要在运行任何其他Kafka脚本之前,通过在shell session 中将其导出(或
unset
)导出为其他值来暂时覆盖该设置。
关于kubernetes - Kafka + Kubernetes + Helm + `/usr/bin/kafka-avro-console-consumer`吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52997194/