找到你要的答案

Q:how do we increase the maximum fetch size for kafka spout

Q:我们如何增加卡夫卡喷管最大取径

I am using kafkaspout, I would like to increase the maximum fetch size in KafkaSpout. Can you please share your thoughts?

我用kafkaspout,我想增加最大抓取大小KafkaSpout。你能分享你的想法吗?

answer1: 回答1:

You can adjust message fetch size in one of two ways, either by by changing the Kafka spout's configuration programmatically or by altering the configuration of the Kafka server directly.

To change the spout's configuration, the Kafka spout documentation tells us to set the the spout's config's fetchSizeBytes variable. Assuming this is being done doing this in java:

spoutConfig.fetchSizeBytes = maximumFetchSize;

The other option, i.e. to adjust the Kafka configuration, first find Kafka's server.properties, then change that configuration, finally restart the Kafka server.

The Kafka configuration will most likely be in the config directory off of the Kafka's home directory. Adjust the appropriate configuration value by adding something similar to the following line to server.properties:

message.max.bytes=some_new_integer_value

Then restart the Kafka process. Best practice will be to repeat this change on all hosts in the cluster.

你可能有两种调整提取信息的大小,可以通过改变卡夫卡嘴的配置以编程方式或通过改变卡夫卡服务器的配置直接。

改变喷嘴的配置,卡夫卡嘴文件告诉我们设置喷的配置的fetchsizebytes变量。假设这是java做的:

spoutConfig.fetchSizeBytes = maximumFetchSize;

另一种选择,即调整的卡夫卡结构,先找到卡夫卡的server.properties,然后更改配置,最后重新启动服务器卡夫卡。

卡夫卡配置将最有可能在卡夫卡的主目录的配置目录关闭。通过添加一些类似下面的线server.properties调整合适的配置值:

message.max.bytes=some_new_integer_value

然后重新启动卡夫卡过程。最好的做法是在集群中的所有主机上重复此更改。

apache-kafka