简体   繁体   English

当只有一个经纪人可及时,是否有可能产生卡夫卡话题?

[英]Is it possible to produce to a kafka topic when only 1 of the brokers is reachable?

Is it possible to produce to a Kafka topic when only 1 of the brokers is reachable from the producer, none of the zookeeper nodes are reachable from the producer, but all of the brokers are healthy and are reachable from each other? 当生产者只能联系到一个经纪人,生产者无法联系到任何动物园管理员节点,但所有经纪人都健康且可以相互联系时,是否有可能产生卡夫卡主题?

For example, this would be required if I were to produce messages via an SSH tunnel. 例如,如果我要通过SSH隧道生成消息,则需要这样做。 If this were for a temporary push I could possibly create the topic with replication factor 1 and have all partitions assigned to the broker in question, and reassign the partitions after the fact, but I'm hoping there is a more flexible setup. 如果这是临时推送,则可以创建复制因子为1的主题,并将所有分区分配给有问题的代理,然后在事后重新分配分区,但是我希望有一个更灵活的设置。

This is all using the java client. 这全部使用java客户端。

Producers don't interact with Zookeeper so it's not an issue. 生产者不与Zookeeper进行交互,因此这不是问题。

The only requirement for Producers is to be able to connect to the brokers that are leaders for the partitions they want to use. 生产者的唯一要求是能够连接到作为他们要使用的分区的领导者的代理。

If the broker you connect to is the leader for the partitions you want to use, then yes you can produce to it. 如果您连接的代理是您要使用的分区的领导者,那么可以的话,您可以为其生产。

Otherwise it's not going to work. 否则它将无法正常工作。 Also creating a topic may not help as its partitions could be assigned to any brokers. 创建主题可能也无济于事,因为其分区可以分配给任何代理。 Also in order to create a topic, a client has to connect to the controller which may not be the broker you can reach. 同样,为了创建主题,客户端必须连接到可能不是您可以联系的代理的控制器。

If you can only connect to 1 "thing", you may want to consider using something like a REST Proxy . 如果您只能连接到1个“事物”,则可能要考虑使用诸如REST Proxy之类的东西。 Your "isolated" environment could send REST requests to the proxy which is able to connect to all brokers in the cluster. 您的“隔离”环境可以将R​​EST请求发送到能够连接到集群中所有代理的代理。

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

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