如何 运行 模式注册表的两个实例

How to run two instances of 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 通信并实现高可用性?

您可以使用 Kafka 领导者选举或 Zookeeper 领导者选举。

在同一台机器上连接到同一台 Kafka/Zookeeper 的两个实例之间唯一需要更改的是端口和侦听器 属性

要适当地配置高可用性,您需要一个 HTTP 负载平衡器来为所有实例提供一个地址。