kafka:warn producer/broker/0 累计最大请求,等待空间

esbemjvw  于 2021-06-07  发布在  Kafka
关注(0)|答案(2)|浏览(1835)

当filebeat将数据输出到kafka时,filebeat日志中有许多警告消息。
..


* WARN producer/broker/0 maximum request accumulated, waiting for space

* WARN producer/broker/0 maximum request accumulated, waiting for space

..
我的filebeat配置中没有什么特别之处:
..

output.kafka:

  hosts: ["localhost:9092"]

  topic: "log-oneday"

..
我还更新了Kafka中的这些套接字设置:
...

socket.send.buffer.bytes=10240000

socket.receive.buffer.bytes=10240000

socket.request.max.bytes=1048576000

queued.max.requests=1000

...
但没有起作用。
我有什么遗漏吗?或者我必须把这个数字增加一点?
此外,kafka服务器日志中未发现任何错误或异常
有Maven对此有什么看法吗?
谢谢

yx2lnoni

yx2lnoni1#

显然你的主题只有一个分区。尝试为主题增加分区。有关更多信息,请参阅下面的链接。

分区越多,吞吐量就越高

https://www.confluent.io/blog/how-to-choose-the-number-of-topicspartitions-in-a-kafka-cluster/
https://kafka.apache.org/documentation/#basic_ops_modify_topic
请尝试以下命令(用特定用例替换info):

bin/kafka-topics.sh --zookeeper zk_host:port/chroot --alter --topic my_topic_name  --partitions 40
ljsrvy3e

ljsrvy3e2#

您需要配置3件事:
经纪人
filebeat kafka输出
消费者
下面是一个示例(根据您的环境更改路径)。
代理配置:


# open kafka server configuration file

vim /opt/kafka/config/server.properties

# add this line

# The largest record batch size allowed by Kafka.

message.max.bytes=100000000

# restart kafka service

systemctl restart kafka.service

filebeat kafka输出:

output.kafka:
  ...
  max_message_bytes: 100000000

使用者配置:


# larger than the max.message.size

max.partition.fetch.bytes=200000000

相关问题