简体   繁体   English

Kafka-从多个服务器收集日志。 每个运行的生产者都应该写相同的主题吗?

[英]Kafka - collect logs from multiple servers. Should each producer running on write to the same topic?

I am learning to use Kafka. 我正在学习使用Kafka。 I would like to implement a centralized log service using Kafka. 我想使用Kafka实现集中式日志服务。 I have multiple servers running my application, I would like my application to write their log to Kafka (ie producers) and then a consumer on the other side to read the logs back. 我有多个运行我的应用程序的服务器,我希望我的应用程序将它们的日志写到Kafka(即生产者),然后在另一侧的消费者写回日志。 I would like to use the same topic for all my applications. 我想对所有应用程序使用相同的主题。 For example, I would like my application to write to a topic called "AppLog" and then have the consumer just read the AppLog topic back. 例如,我希望我的应用程序写一个名为“ AppLog”的主题,然后让使用者只读回AppLog主题。

Does Kafka support multiple producers writing to the same topic? Kafka是否支持多个制作人编写同一主题?

Note: The relative sequences of the log does not matter to me. 注意:日志的相对顺序对我来说无关紧要。

Any help is appreciated. 任何帮助表示赞赏。 Thanks ahead. 谢谢你

如果在这里看看您会发现即使一个主题有40个生产者也不会对性能产生太大的影响,所以是的,您可以使用多个生产者来写一个主题。

Yes, you can have as many producers as you want writing to the same topic. 是的,您可以为同一主题编写尽可能多的制作人。 To improve parallelism you can scale your topic increasing the number of partitions and use more brokers (Kafka servers) in your cluster. 为了提高并行度,您可以扩展主题以增加分区数,并在群集中使用更多代理(Kafka服务器)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在使用Kafka Producer Api将文件中的消息写入kafka主题,但是kafka主题的日志显示为空? - I am using Kafka Producer Api to write messages from a file into kafka topic, but the logs of kafka topic is showing empty? 卡夫卡多个制片人写同一主题? - Kafka multiple producer writing to same topic? Kafka Producer(具有多个实例)写入同一主题 - Kafka Producer (with multiple instance) writing to same topic 哪个生产者收集Web服务器日志并将其转换为Avro格式并写入kafka? - What producer collect and convert webserver logs to avro format and write to kafka? Apache Kafka Producer-编写主题 - Apache Kafka Producer - Write to a Topic 如果我有多个生产者向 Kafka 生产相同的数据,为每个生产者配置一个主题或为所有生产者配置一个主题是否有效 - If I have multiple producers producing same data to Kafka,Is it efficient to configure one topic for each producer or one topic for all producers Kafka Producer未写入kafka主题 - Kafka Producer does not write to kafka topic Kafka多个制作人写同一主题 - 消息和数据突发的排序 - Kafka multiple producer writing to same topic - Ordering of message and data burst Python Kafka生产者无法写入主题 - Python Kafka producer unable to write to topic Kafka Producer、Broker 和 Topic 中的相同配置 - Same configuration in Kafka Producer, Broker and Topic
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM