Kafka MirrorMaker 2.0 复制流程问题:始终写入同一集群

Kafka MirrorMaker 2.0 Replication Flow Issue: Always writes to the same cluster

作为 DR 计划的一部分,我正在实施 Kafka MirrorMaker 2.0 以在 2 个集群之间复制数据。

此时我只是想做一个简单的active/passive设计。

这是我的 mm2.properties 文件:

# Licensed to the Apache Software Foundation (ASF) under A or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
# 
#    http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# see org.apache.kafka.clients.consumer.ConsumerConfig for more details

# Sample MirrorMaker 2.0 top-level configuration file
# Run with ./bin/connect-mirror-maker.sh connect-mirror-maker.properties 

# specify any number of cluster aliases
clusters = west, central

# connection information for each cluster
# This is a comma separated host:port pairs for each cluster
# for e.g. "A_host1:9092, A_host2:9092, A_host3:9092"
west.bootstrap.servers = kafka-west.com:30002
central.bootstrap.servers = kafka-central.com:30002

# enable and configure individual replication flows
west->central.enabled = true
central->west.enabled = false

# Setting replication factor of newly created remote topics
replication.factor=3

############################# Internal Topic Settings  #############################
# The replication factor for mm2 internal topics "heartbeats", "B.checkpoints.internal" and
# "mm2-offset-syncs.B.internal"
# For anything other than development testing, a value greater than 1 is recommended to ensure availability such as 3.
checkpoints.topic.replication.factor=3
heartbeats.topic.replication.factor=3
offset-syncs.topic.replication.factor=3

# The replication factor for connect internal topics "mm2-configs.B.internal", "mm2-offsets.B.internal" and
# "mm2-status.B.internal"
# For anything other than development testing, a value greater than 1 is recommended to ensure availability such as 3.
offset.storage.replication.factor=3
status.storage.replication.factor=3
config.storage.replication.factor=3

# customize as needed
# replication.policy.separator = _
# sync.topic.acls.enabled = false
# emit.heartbeats.interval.seconds = 5

问题出在这里(我想?):

west->central.enabled = true
central->west.enabled = false

无论我如何配置流程,我都只能看到在 west 集群上写入的数据。即使两个流都为 true,west 集群也会得到 west.topiccentral.topic。同时,central 集群永远不会得到任何复制。

我在两个集群中也有 运行 这个 Mirror-Maker 配置,由于某种原因它总是被写入 west 集群。

我不明白为什么会这样,提前谢谢你的帮助。

编辑: 我有点失去理智了。我将两个 URL 都改为 central,如下所示:

west.bootstrap.servers = kafka-central.com:30002
central.bootstrap.servers = kafka-central.com:30002

它仍然写入 west 集群...这怎么可能,他甚至不知道 west 集群在哪里?我什至检查了 DNS,它们是正确的。

原来 central 集群上我的代理中有一些东西指向 west 集群上的 Loadbalancer。

修复代理后,复制流程再次正确