简体   繁体   中英

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

I am learning to use Kafka. I would like to implement a centralized log service using 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. 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.

Does Kafka support multiple producers writing to the same topic?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM