2018年2月28日星期三

kafka bootstrap servers配置

A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. The client will make use of all servers irrespective of which servers are specified here for bootstrapping—this list only impacts the initial hosts used to discover the full set of servers. This list should be in the form host1:port1,host2:port2,.... Since these servers are just used for the initial connection to discover the full cluster membership (which may change dynamically), this list need not contain the full set of servers (you may want more than one, though, in case a server is down).

一组host和port用于初始化连接. 不管这里配置了多少台server, 都只是用作发现整个集群全部server信息. 这个配置不需要包含集群所有的机器信息. 但是最好多于一个, 以防服务器挂掉.

如果只配置了一个的话,这个server挂掉了kafka集群就无法工作。

具体点说,如果producer.properties中的bootstrap.servers都挂掉,producer无法工作;如果consumer.properties中的bootstrap.servers都挂掉,consumer无法工作。

没有评论:

发表评论