原因分析
- 设置kafka连接 max_block_ms 是否太小,连接超时
遇到的问题解决
- kafka连接问题,需要在kafka yml文件或启动命令中添加inside和outside配置,如下图示例:
environment:
#HOSTNAME_COMMAND: "route -n | awk '/UG[ \t]/{print $$2}'"
#KAFKA_ADVERTISED_PORT: 9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
#KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 60000
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
kAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9092,OUTSIDE://172.17.132.115:19092
KAFKA_LISTENERS: INSIDE://:9092,OUTSIDE://:19092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
网友评论