I have a question about the failover in the scenario.
Let's say that we have two clusters K1 and K2 and configured MM2 replication for TOPIC1 (originally created in just K1
).
We configured the active-active replication:
K1->K2.enabled = true
K2->K1.enabled = true
K1->K2.topics = .*
K2->K1.topics = .*
On starting mirror maker 2, I see that topics are replicated from cluster K1
to K2
in the naming format K1.topic_name_here
and vice versa for topics from cluster K2
to K1
.
I see that there was no topic TOPIC1
created in K2
, only K1.TOPIC1
was created. I see this scenario working for consumers, as in the beginning the consumers consume TOPIC1
from cluster K1
. When the cluster K1
out of service, fail over happens. Consumers start to consume K1.TOPIC1
from K2
.
My questions are as follows:
- For producers, they won't producer to the topic
K1.TOPIC1
in cluster K2, my question is how do the producers go about producing data. Do I need to manually create a topicTOPIC1
in cluster K2 and this topic will be used for producing messages to when failover happens. - If the above scenario is true, how do I move back to my primary cluster K1. As, now the topic
TOPIC1
in cluster K2 has digressed from the topicTOPIC
in K1. How do we sync the messages in this scenario ?