Kafka1.0.0 Producer发送消息出现异常 Batch containing 1 record(s) expired

Kafka 1.0.0 Java Client TimeoutException: Batch containing 1 record(s) expired time = 300592...

1.最开始去查看server.properties,默认是30 s,修改成50 s,还是不行

   //props.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG,"50000");

2.最后发现是 server.properties未配置正确listen服务造成的

开始的配置:# The address the socket server listens on. It will get the value returned from
# java.net.InetAddress.getCanonicalHostName() if not configured.
#   FORMAT:
#     listeners = listener_name://host_name:port
#   EXAMPLE:
#     listeners = PLAINTEXT://your.host.name:9092
此处没有设置listeners
后面的配置:# The address the socket server listens on. It will get the value returned from
# java.net.InetAddress.getCanonicalHostName() if not configured.
#   FORMAT:
#     listeners = listener_name://host_name:port
#   EXAMPLE:
#     listeners = PLAINTEXT://your.host.name:9092
listeners=PLAINTEXT://192.168.2.100:9092 #需要将每台机器都修改

3.Java client修改

private final static String BOOTSTRAP_SERVERS = "server00:9092,server01:9093";
4.连接ok


你可能感兴趣的:(hadoop,kafka)