[英]Is Kafka topic linked with zookeeper and If zookeeper changed will topic disappeare
I was working with Kafka . 我和卡夫卡一起工作。 I downloaded the zookeeper , extracted and started it.
我下载了zookeeper并解压缩并启动了它。 Then I downloaded Kafka , extracted the zipped file and started Kafka .
然后,我下载了Kafka ,提取了压缩文件并启动了Kafka 。 Everything was working good.
一切都很好。 I created few topics and I was able to send and receive messages.
我创建了几个主题,并且能够发送和接收消息。 After that I stopped Kafka and Zookeeper .
之后,我停止了Kafka和Zookeeper 。 Then I read that Kafka itself provides Zookeeper .
然后我读到Kafka本身提供了Zookeeper 。 So I started Zookeeper that was provided with Kafka .
因此,我启动了Kafka随附的Zookeeper 。 However the data directory for it was different, and then I started Kafka from same configuration file and same data directory location.
但是它的数据目录不同,然后我从相同的配置文件和相同的数据目录位置启动了Kafka 。 However after starting Kafka I could not find the topics that I had created.
但是,在启动Kafka之后,我找不到我创建的主题。
I just want to know that, does this mean the meta data about the topics is maintained by Zookeeper . 我只想知道,这是否意味着有关主题的元数据由Zookeeper维护。 I searched Kafka documentation, however, I could not find anything in detail.
我搜索了Kafka文档,但是找不到详细信息。 https://kafka.apache.org/documentation/
https://kafka.apache.org/documentation/
Check this documentation provided by confluent. 检查合流提供的此文档。 According to this
Apache Kafka® uses ZooKeeper to store persistent cluster metadata and is a critical component of the Confluent Platform deployment. For example, if you lost the Kafka data in ZooKeeper, the mapping of replicas to Brokers and topic configurations would be lost as well, making your Kafka cluster no longer functional and potentially resulting in total data loss.
据此,
Apache Kafka® uses ZooKeeper to store persistent cluster metadata and is a critical component of the Confluent Platform deployment. For example, if you lost the Kafka data in ZooKeeper, the mapping of replicas to Brokers and topic configurations would be lost as well, making your Kafka cluster no longer functional and potentially resulting in total data loss.
Apache Kafka® uses ZooKeeper to store persistent cluster metadata and is a critical component of the Confluent Platform deployment. For example, if you lost the Kafka data in ZooKeeper, the mapping of replicas to Brokers and topic configurations would be lost as well, making your Kafka cluster no longer functional and potentially resulting in total data loss.
So, the answer to your question is, yes, the purpose of zookeeper is to store relevant metadata about the kafka brokers, topics, etc,. 因此,您的问题的答案是,是的,zookeeper的目的是存储有关kafka代理,主题等的相关元数据。
Also, since you have just started working on Kafka and Zookeeper, I would like to mention this. 另外,由于您刚刚开始研究Kafka和Zookeeper,因此我想提一下。 By default, Kafka stored it's data in a temp location which get's deleted on system reboot, so you should change that as well.
默认情况下,Kafka将其数据存储在一个临时位置,该位置会在系统重启时被删除,因此您也应该更改它。
the answer to your question tag is yes, 问号的答案是肯定的,
1)Initially you started standalone zookeeper from zip file and you stopped the zookeeper, which means the topics that are created are stored in the zookeeper standalone are lost.Now you persistent cluster metadata related to Kafka is lost . 1)最初,您从zip文件启动了独立的zookeeper,然后停止了zookeeper,这意味着创建的主题存储在zookeeper 独立版本中,现在丢失了与Kafka相关的持久集群元数据。
2)second time you started the zookeeper from the package that comes along with Kafka, now the new zookeeper instance does not have any topics information that you created previously, so you need to create newly . 2)第二次从Kafka随附的软件包中启动zookeeper时,现在新的zookeeper实例不具有您先前创建的任何主题信息,因此您需要重新创建。
3) suppose in case 1: if you close the terminal and start again the zookeeper from standalone , you no need to create the Topic again ,but if you stopped the zookeeper server from standalone then topics are lost. 3)假设情况1:如果关闭终端并从独立模式重新启动Zookeeper,则无需再次创建Topic,但是如果从独立模式停止Zookeeper服务器,则主题将丢失。
in simple : you created two separate zookeeper instances, where topics will not be shared between them . 简而言之 :您创建了两个单独的zookeeper实例,它们之间不会共享主题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.