Kafka Replicator is an easy to use tool for copying data between two Apache Kafka clusters with configurable re-partitionning strategy.
Data will be read from topics in the origin cluster and written to a topic/topics in the destination cluster according config rules.
Lets start with an overview of features that exist in kafka-replicator:
shell
libsasl2-dev
libssl-dev
If you have the Rust toolchain already installed on your local system.
shell
rustup update stable
cargo install kafka-replicator
Clone the repository and change it to your working directory.
```shell git clone https://github.com/lispython/kafka-replicator.git cd kafka-replicator
rustup override set stable rustup update stable cargo install ```
shell
RUST_LOG=info kafka-replicator /path/to/config.yml
shell
sudo docker run -it -v /replication/:/replication/ -e RUST_LOG=info lispython/kafka_replicator:latest kafka-replicator /replication/config.yml
``` yaml clusters: - name: cluster1 hosts: - replicator-kafka-1:9092 - replicator-kafka-1:9092 - name: cluster2 hosts: - replicator-kafka-2:9092
clients: - client: cl1client1 cluster: cluster1 config: # optional message.timeout.ms: 5000 auto.offset.reset: earliest - client: cl2client1 cluster: cluster2
routes: - upstreamclient: cl1client1 downstreamclient: cl1client1 upstreamtopics: - 'topic1' downstreamtopic: 'topic2' repartitioningstrategy: random # strictp2p | random upstreamgroupid: group22 progresseverysecs: 10 limits: messagespersec: 10000 numberof_messages:
upstreamclient: cl1client1 downstreamclient: cl2client1 upstream_topics:
upstreamclient: cl2client1 downstreamclient: cl1client1 upstream_topics:
observers: - client: cl1client1 name: "my name" topics: - 'topic1' - 'topic2' fetchtimeoutsecs: 5 showprogresseverysecs: 10
client: cl2client_1 topic: 'topic3' topics:
client: cl1client_1 topic: 'topic1' topics: [] ```
Root config options: - clusters - are a list of Kafka Clusters - clients - are a list of configurations for consumers - routes - are a list of replication rules - observers - are a list of observers
Any suggestion, feedback or contributing is highly appreciated. Thank you for your support!