目的
使用mm2进行kafka集群迁移的时候默认配会给target 集群的topic加一个前缀。要想去掉前缀需要使用如下配置添加一条副本策略(replication.policy.class: “org.apache.kafka.connect.mirror.IdentityReplicationPolicy”)。
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaMirrorMaker2
metadata:name: my-mirror-maker-2
spec:version: 3.9.0replicas: 1connectCluster: "cluster-b" # Must be the target custerclusters:- alias: "cluster-a" # Source clusterbootstrapServers: cluster-a-kafka-bootstrap:9092- alias: "cluster-b" # Target clusterbootstrapServers: cluster-b-kafka-bootstrap:9092config:# -1 means it will use the default replication factor configured in the brokerconfig.storage.replication.factor: -1offset.storage.replication.factor: -1status.storage.replication.factor: -1mirrors:- sourceCluster: "cluster-a"targetCluster: "cluster-b"sourceConnector:tasksMax: 1config:# -1 means it will use the default replication factor configured in the brokerreplication.factor: -1offset-syncs.topic.replication.factor: -1sync.topic.acls.enabled: "false"replication.policy.class: "org.apache.kafka.connect.mirror.IdentityReplicationPolicy"refresh.topics.interval.seconds: 600checkpointConnector:tasksMax: 1config:# -1 means it will use the default replication factor configured in the brokercheckpoints.topic.replication.factor: -1replication.policy.class: "org.apache.kafka.connect.mirror.IdentityReplicationPolicy"sync.group.offsets.enabled: "false"refresh.groups.interval.seconds: 600topicsPattern: ".*"groupsPattern: ".*"