如何在Kafka通过Confluent Helm Charts运行的情况下使用标准kafka-avro-console-consumer
工具?建议用于运行cli实用程序的confluentinc/cp-kafka:5.0.0
映像不包含kafka-avro-console-consumer
。
如果我进入模式注册表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:端口已在使用:5555;
听起来您已经通过KAFKA_JMX_PORT
变量将JMX作为容器的一部分启用了。
如果是这种情况,那么在运行任何其他Kafka脚本之前,您需要通过在shell会话中将其导出(或unset
(到不同的值来临时覆盖它