2015-10-15 54 views
2

通过卡夫卡Quick Start阅读,(在这种情况下是localhost)创建绑定到一个动物园管理员实例的话题是非常简单的使用命令创建卡夫卡话题多饲养员实例

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test 

但是,如果我有3个是什么Zookeeper服务器正在运行?我是否只需要包含一个Zookeeper网址,并将其他Zookeeper实例通知给这个新主题以帮助容错?还是我需要提供所有这些?

回答

5

如果您正在运行ZK群集,则只能使用一个ZK连接字符串(host:port)。主题更改将自动传播到所有动物园管理员节点。

如果你想指定多个ZK主机(故障转移),用逗号分隔的字符串,如:主机1:端口1,主机2:端口2,主机3:端口3

+1

如果你有不同的chroot(而不是/)。是正确的格式:host1:port1,host2:port2,host3:port3/chroot或host1:port1/chroot,host2:port2/chroot,host3:port3/chroot? – andresp

+1

显然是前者。 https://issues.apache.org/jira/browse/KAFKA-1664?focusedCommentId=14155908&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14155908 – andresp