# Scale MirrorMaker2 to Run Multiple Instances

**URL:** <https://forum.confluent.io/t/scale-mirrormaker2-to-run-multiple-instances/4448>\
**Category:** Cluster Replication\
**Created:** [14 March 2022 19:17 UTC](https://forum.confluent.io/t/scale-mirrormaker2-to-run-multiple-instances/4448 "2022-03-14T19:17:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jk4102](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/jk4102/32/1678_2.png) [@jk4102](https://forum.confluent.io/u/jk4102)\
**Post date:** [14 March 2022 19:17 UTC](https://forum.confluent.io/t/scale-mirrormaker2-to-run-multiple-instances/4448/1 "2022-03-14T19:17:16Z")

</div>

Hello!  
I’m wondering if it’s possible to run multiple instances of MM2 per data center? I am trying to run 2 instances of connect-mirror-maker.sh per data center for scalability purposes. However, I cannot get 2 instances to work at the same time: once I start up the second mirror maker, it takes over for the first one, and the first one completely stops replicating.  
What am I missing here? Would greatly appreciate any guidance.  
Thank you!

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [15 March 2022 06:49 UTC](https://forum.confluent.io/t/scale-mirrormaker2-to-run-multiple-instances/4448/2 "2022-03-15T06:49:14Z")

</div>

Hi @jk4102

welcome to the forum 🙂

could you elaborate a bit more?  
what would you like to achieve ? replicate the same topic with two independent mirror maker instances?

best,  
michael

---

<div class="post-metadata">

**Author:** ![jk4102](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/jk4102/32/1678_2.png) [@jk4102](https://forum.confluent.io/u/jk4102)\
**Post date:** [15 March 2022 15:26 UTC](https://forum.confluent.io/t/scale-mirrormaker2-to-run-multiple-instances/4448/3 "2022-03-15T15:26:21Z")

</div>

Hi @mmuehlbeyer, thanks for your response 🙂

I would like to replicate Kafka events between two data centers with two independent mirror maker instances, in a way that lets me load balance between the two mirror makers rather than have the two instances both do the same work. So, if I have my mirror makers replicating from A to B, I would like one instance to handle part of the produced events and the other instance to handle the rest. And if one mirror maker instance were to go down, the process would rebalance so that the remaining instance would pick up from where it left off and become responsible for all replication until the second instance becomes available again. That could mean that both mirror makers are replicating different parts of the same topic, but NOT that they are both replicating the whole topic

Thank you so much

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [15 March 2022 16:28 UTC](https://forum.confluent.io/t/scale-mirrormaker2-to-run-multiple-instances/4448/4 "2022-03-15T16:28:16Z")

</div>

hi @jk4102

ok understood.  
basically it should be possible.  
did you configure as the documentation states ?  
[https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0#KIP382:MirrorMaker2.0-RunningadedicatedMirrorMakercluster](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0#KIP382:MirrorMaker2.0-RunningadedicatedMirrorMakercluster)

is there some traffic going on the topics?

best,  
michael

---

<div class="post-metadata">

**Author:** ![jk4102](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/jk4102/32/1678_2.png) [@jk4102](https://forum.confluent.io/u/jk4102)\
**Post date:** [17 March 2022 19:46 UTC](https://forum.confluent.io/t/scale-mirrormaker2-to-run-multiple-instances/4448/5 "2022-03-17T19:46:18Z")

</div>

Yes, I’m using below configuration, and there is traffic in the topic.  
mm2.properties config:

```auto
clusters = A, B

A.bootstrap.servers = localhost:9092
B.bootstrap.servers = localhost:9093

A->B.enabled = true
A->B.topics = .*
B->A.enabled = false

checkpoints.topic.replication.factor=1
heartbeats.topic.replication.factor=1
offset-syncs.topic.replication.factor=1

offset.storage.replication.factor=1
status.storage.replication.factor=1
config.storage.replication.factor=1

```

---

<div class="post-metadata">

**Author:** ![haeuserd](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/haeuserd/32/1692_2.png) [@haeuserd](https://forum.confluent.io/u/haeuserd)\
**Post date:** [18 March 2022 10:48 UTC](https://forum.confluent.io/t/scale-mirrormaker2-to-run-multiple-instances/4448/6 "2022-03-18T10:48:05Z")

</div>

Unfortunately MirrorMaker 2 currently does not fully support multiple instances when running in dedicated cluster mode (`connect-mirror-maker.sh`). This is going to be fixed with [KIP-710](https://cwiki.apache.org/confluence/display/KAFKA/KIP-710%3A+Full+support+for+distributed+mode+in+dedicated+MirrorMaker+2.0+clusters).

As long as this is not fixed I would not recommend to run multiple instances of MirrorMaker in dedicated cluster mode, because of the failure scenarios described in the KIP.

---

<div class="post-metadata">

**Author:** ![cumba90](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/cumba90/32/4947_2.png) [@cumba90](https://forum.confluent.io/u/cumba90)\
**Post date:** [21 February 2025 08:28 UTC](https://forum.confluent.io/t/scale-mirrormaker2-to-run-multiple-instances/4448/7 "2025-02-21T08:28:33Z")

</div>

I have the same question but in the field of High Availability and Fault Tolerance of MM2. Does it possible to run multiple instances of MM2 in Kafka connect to replicate same topic that would be created in different host ? My expectations if one worker goes down the MM2 will continue replicating data using other workers.

I tried to create 3 instances of MM2 Connector to replicate one topic and specified same consumer group in parameter “consumer.group.id” but i’ve got duplicates in destination topic equals to number of MM2 Connector instances.
