简体   繁体   English

Kafka 领导人选举

[英]Kafka leader election

My application produces data to Kafka and uses Zookeeper to do leader election.我的应用程序向 Kafka 生成数据并使用 Zookeeper 进行领导选举。 Now that Kafka won't be needing Zookeeper anymore, I need to move away from it too, because I don't want to keep it in my infrastructure just for that.现在 Kafka 不再需要 Zookeeper,我也需要离开它,因为我不想为此将它保留在我的基础设施中。 So, does Kafka provide an API to achieve leader election?那么,Kafka有没有提供API来实现leader选举呢? Or I would have to do it manually, creating a topic and coming up with my own logic?或者我必须手动完成,创建一个主题并提出我自己的逻辑? My application have many instances but only one of them should produce to Kafka at the same time, so I need a kind of distributed lock and I was hoping to do it in an easy way using Kafka itself or k8s, avoiding have to add another piece to my infrastructure.我的应用程序有很多实例,但其中只有一个应该同时生成给 Kafka,所以我需要一种分布式锁,我希望使用 Kafka 本身或 k8s 以一种简单的方式完成它,避免必须添加另一块到我的基础设施。

Now that Kafka won't be needing Zookeeper anymore... does Kafka provide an API to achieve leader election现在Kafka不需要Zookeeper了... Kafka有没有提供API来实现leader选举

It will use a Raft protocol internal to the brokers , yes,它将使用经纪人内部的 Raft 协议,是的,

I doubt it is intended to be multi-purpose for external usage, like Zookeeper.我怀疑它是否打算像 Zookeeper 这样用于外部用途的多用途。

distributed lock... k8s分布式锁... k8s

You could use etcd你可以使用 etcd

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

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