question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bidirectional data replication not happening in strimzi mirrormaker2

See original GitHub issue

Hello, I am using Strimzi MirrorMaker2 for replicating data between two kafka clusters. Bidirectional data replication is not happening in my case. I’m using strimzi operator 0.26 and kafka 2.8.0. Please let me know any special configuration required to enable bidirectional data replication in following mirrormaker2 configurations.

->From source to target cluster able to replicated topics and data but from target to source data replication is not happening. ->Topics are getting duplicated in both kafka clusters. -> How can we configure data flow policies from A -> B and B-> A clusters, any example configuration file is there.

Providing my mirrormaker.yaml file

apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaMirrorMaker2
metadata:
 name: my-mirror-maker-2
spec:
 version: 2.8.0
 replicas: 1
 connectCluster: "my-target-cluster"
 clusters:
 - alias: "my-source-cluster"
   bootstrapServers: xxxx:30056
   tls:
     trustedCertificates:
       - secretName: my-cluster-cluster-ca-cert
         certificate: ca.crt
 - alias: "my-target-cluster"
   bootstrapServers: xxxx:30054
   tls:
     trustedCertificates:
       - secretName: my-target-cluster-cluster-ca-cert
         certificate: ca.crt
   config:
     config.storage.replication.factor: -1
     offset.storage.replication.factor: -1
     status.storage.replication.factor: -1
 mirrors:
 - sourceCluster: "my-source-cluster"
   targetCluster: "my-target-cluster"
   sourceConnector:
     config:
       replication.factor: 1
       offset-syncs.topic.replication.factor: 1
       sync.topic.acls.enabled: "false"
       refresh.topics.interval.seconds: 5
   heartbeatConnector:
     config:
       heartbeats.topic.replication.factor: 1
   checkpointConnector:
     config:
       checkpoints.topic.replication.factor: 1
   topicsPattern: ".*"
   groupsPattern: ".*"
 resources:
   requests:
     cpu: 200m
     memory: 2Gi
   limits:
     cpu: 250m
     memory: 2Gi

Topics list from source kafka c;usters:

[kafka@my-cluster-kafka-0 kafka]$ ./bin/kafka-topics.sh --bootstrap-server localhost:9092 --list __consumer_offsets __strimzi-topic-operator-kstreams-topic-store-changelog __strimzi_store_topic cluster-c1 cluster-c1-1 heartbeats mirrormaker2-cluster-configs mirrormaker2-cluster-offsets mirrormaker2-cluster-status mm2-offset-syncs.my-target-cluster.internal my-cluster-connect-cluster-configs my-cluster-connect-cluster-offsets my-cluster-connect-cluster-status my-source-cluster.checkpoints.internal my-source-cluster.cluster-c2 my-source-cluster.heartbeats my-source-cluster.mirrormaker2-cluster-configs my-source-cluster.mirrormaker2-cluster-offsets my-source-cluster.mirrormaker2-cluster-status my-source-cluster.my-source-cluster.cluster-c1 my-source-cluster.my-source-cluster.cluster-c1-1 my-source-cluster.my-source-cluster.heartbeats my-source-cluster.my-source-cluster.mirrormaker2-cluster-configs my-source-cluster.my-source-cluster.mirrormaker2-cluster-offsets my-source-cluster.my-source-cluster.mirrormaker2-cluster-status my-source-cluster.my-source-cluster.my-cluster-connect-cluster-configs my-source-cluster.my-source-cluster.my-cluster-connect-cluster-offsets my-source-cluster.my-source-cluster.my-cluster-connect-cluster-status my-source-cluster.my-source-cluster.my-source-cluster.cluster-c2 my-source-cluster.my-source-cluster.my-source-cluster.heartbeats my-source-cluster.my-source-cluster.my-source-cluster.mirrormaker2-cluster-configs my-source-cluster.my-source-cluster.my-source-cluster.mirrormaker2-cluster-offsets my-source-cluster.my-source-cluster.my-source-cluster.mirrormaker2-cluster-status my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.cluster-c1 my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.cluster-c1-1

Mirrormaker pod logs:

2021-11-08 15:39:24,512 INFO Found 0 new topic-partitions on my-source-cluster. Found 0 deleted topic-partitions on my-source-cluster. Found 41 topic-partitions missing on my-target-cluster. (org.apache.kafka.connect.mirror.MirrorSourceConnector) [Scheduler for MirrorSourceConnector-refreshing topics] 2021-11-08 15:39:24,517 INFO refreshing topics took 21 ms (org.apache.kafka.connect.mirror.Scheduler) [Scheduler for MirrorSourceConnector-refreshing topics] 2021-11-08 15:39:24,518 INFO SourceConnectorConfig values: config.action.reload = restart connector.class = org.apache.kafka.connect.mirror.MirrorSourceConnector errors.log.enable = false errors.log.include.messages = false errors.retry.delay.max.ms = 60000 errors.retry.timeout = 0 errors.tolerance = none header.converter = null key.converter = null name = my-source-cluster->my-target-cluster.MirrorSourceConnector predicates = [] tasks.max = 1 topic.creation.groups = [] transforms = [] value.converter = null (org.apache.kafka.connect.runtime.SourceConnectorConfig) [DistributedHerder-connect-1-1] 2021-11-08 15:39:24,518 INFO EnrichedConnectorConfig values: config.action.reload = restart connector.class = org.apache.kafka.connect.mirror.MirrorSourceConnector errors.log.enable = false errors.log.include.messages = false errors.retry.delay.max.ms = 60000 errors.retry.timeout = 0 errors.tolerance = none header.converter = null key.converter = null name = my-source-cluster->my-target-cluster.MirrorSourceConnector predicates = [] tasks.max = 1 topic.creation.groups = [] transforms = [] value.converter = null (org.apache.kafka.connect.runtime.ConnectorConfig$EnrichedConnectorConfig) [DistributedHerder-connect-1-1] 2021-11-08 15:39:24,519 WARN Could not create topic my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.target-topic. (org.apache.kafka.connect.mirror.MirrorSourceConnector) [kafka-admin-client-thread | adminclient-13] org.apache.kafka.common.errors.InvalidTopicException: Topic name is illegal, it can’t be longer than 249 characters, topic name: my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.target-topic 2021-11-08 15:39:24,519 WARN Could not create topic my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.mirrormaker2-cluster-offsets. (org.apache.kafka.connect.mirror.MirrorSourceConnector) [kafka-admin-client-thread | adminclient-13] org.apache.kafka.common.errors.InvalidTopicException: Topic name is illegal, it can’t be longer than 249 characters, topic name: my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.mirrormaker2-cluster-offsets 2021-11-08 15:39:24,519 WARN Could not create topic my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.source-topic-nov-1. (org.apache.kafka.connect.mirror.MirrorSourceConnector) [kafka-admin-client-thread | adminclient-13] org.apache.kafka.common.errors.InvalidTopicException: Topic name is illegal, it can’t be longer than 249 characters, topic name: my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.source-topic-nov-1 2021-11-08 15:39:24,519 WARN Could not create topic my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.heartbeats. (org.apache.kafka.connect.mirror.MirrorSourceConnector) [kafka-admin-client-thread | adminclient-13] org.apache.kafka.common.errors.InvalidTopicException: Topic name is illegal, it can’t be longer than 249 characters, topic name: my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.my-source-cluster.heartbeats

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
scholzjcommented, Feb 4, 2022

That is not how it works => you can have only one target cluster and multiple sources. But not the other way around.

0reactions
scholzjcommented, Feb 4, 2022

Yeah, but the standalone MM2 setup does not run on top of Kafka Connect. So that is different from what Strimzi supports. Strimzi runs it as connectors on Kafka Connect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing MirrorMaker 2.0 to Strimzi
Apache Kafka MirrorMaker replicates data across two Kafka clusters, within or across data centers. MirrorMaker takes messages from a source ...
Read more >
Mirror Maker 2 Deployment
Using Strimzi operator to deploy on Kubernetes ... For Bi-directional replication for the same topic name, MirrorMaker 2 will use the cluster name...
Read more >
A look inside Kafka Mirrormaker 2 - Cloudera Blog
Test case3: Replication of data from topicA (DC1) to topicA (DC2) after restarting MM2. Only messages that were not copied should be transferred ......
Read more >
Chapter 2. Deployment configuration Red Hat AMQ 2021.q3
JBOD storage is supported only for Kafka, not for ZooKeeper. ... The MirrorMaker 2.0 architecture supports bidirectional replication in an active/active ...
Read more >
How to avoid cycles with mirrormaker - Cluster Replication
But MirrorMaker's configuration does not allow to replicate the same ... a unidirectional data replication setup where replication happens ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found