我正在尝试使用schema registry的两个示例在集群模式下运行kafka,但是我不太确定如何配置第二个示例,以便在第一个示例关闭时接管它。
以下是第一个架构注册表示例的属性文件:
port=8081
# The address the socket server listens on.
# FORMAT:
# listeners = listener_name://host_name:port
# EXAMPLE:
# listeners = PLAINTEXT://your.host.name:9092
listeners=http://0.0.0.0:8081
# Zookeeper connection string for the Zookeeper cluster used by your Kafka cluster
# (see zookeeper docs for details).
# This is a comma separated host:port pairs, each corresponding to a zk
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
kafkastore.connection.url=localhost:2181,localhost:2182,localhost:2183
# Alternatively, Schema Registry can now operate without Zookeeper, handling all coordination via
# Kafka brokers. Use this setting to specify the bootstrap servers for your Kafka cluster and it
# will be used both for selecting the master schema registry instance and for storing the data for
# registered schemas.
# (Note that you cannot mix the two modes; use this mode only on new deployments or by shutting down
# all instances, switching to the new configuration, and then starting the schema registry
# instances again.)
# kafkastore.bootstrap.servers=localhost:9092
# The name of the topic to store schemas in
kafkastore.topic=_schemas
# If true, API requests that fail will include extra debugging information, including stack traces
debug=false
第二个文件应该是什么样的,这样它们既可以与zookeeper通信,又可以实现高可用性?
1条答案
按热度按时间b4qexyjb1#
您可以使用Kafka领导人选举或zookeeper领导人选举。
在连接到同一kafka/zookeeper的同一台计算机上的两个示例之间,唯一需要更改的是port和listeners属性
为了适当地配置高可用性,您需要一个http负载平衡器为所有示例提供一个地址。