Mirroring Topics from an Apache Kafka Cluster to the HPE Cluster
You can use MirrorMaker to mirror data continuously from Apache Kafka clusters to streams in HPE Data Fabric Streams clusters.
Prerequisites
- Because this procedure requires that MirrorMaker be run from the HPE Data Fabric cluster, ensure that the mapr-kafka package is installed on the node that you choose to run MirrorMaker from.
- Configure the node as a mapr client.
- Ensure that the ID of the user that runs MirrorMaker has the
producepermandtopicpermpermissions on the destination stream.
About this task
Alternatively, you can stop mirroring after you migrate the consumers and producers for your applications from your Apache Kafka cluster to your Data Fabric cluster where the stream is located. See in Migrating Apache Kafka 0.9.0 Applications to HPE Data Fabric Streams for details. After you start MirrorMaker, it launches a configurable number of consumer threads to read topics that are in a Kafka cluster and a number of producers to write the messages from those topics into topics in HPE Data Fabric Streams.
Before running MirrorMaker, you create a file that contains the required configuration parameters for the consumers that read from the Apache Kafka cluster. You also create a file that contains the required configuration parameters for the producers that publish to the stream in the HPE Data Fabric cluster. You point to these files in the MirrorMaker command.
To specify which topics you want to mirror, use the
whitelist parameter to provide a Java-style regular
expression that matches the names of the topics that you want mirrored.
Procedure
Example
In this example, the file that lists the properties and values for the consumers that
will read messages from the topics in Apache Kafka is named
consumers.props. It contains this list:
group.id=cg1
bootstrap.servers=10.10.100.87:9093
shallow.iterator.enable=false
The file that lists the properties and values for the producers that will publish
messages to topics in HPE Data Fabric Streams is named
producers.props. It contains this list:
streams.producer.default.stream=/newStream
auto.create.topics.enable=true
The topics to mirror all have names that begin with na_west. When
running the command, we can use "na_west.*" as the regular
expression to use for the whitelist parameter.
Here is the command:
bin/kafka-mirror-maker.sh --consumer.config consumers.props
--num.streams 2 --producer.config producers.props --whitelist="na_west.*"