Kafka replicator

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.

Features

Lets start with an overview of features that exist in kafka-replicator:

Use cases

Installation

System dependencies

shell libsasl2-dev libssl-dev

Install from crates.io

If you have the Rust toolchain already installed on your local system.

shell rustup update stable cargo install kafka-replicator

Compile and run it from sources

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 ```

Usage

shell RUST_LOG=info kafka-replicator /path/to/config.yml

Run it using Docker

shell sudo docker run -it -v /replication/:/replication/ -e RUST_LOG=info lispython/kafka_replicator:latest kafka-replicator /replication/config.yml

Example config

``` 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:

observers: - client: cl1client1 name: "my name" topics: - 'topic1' - 'topic2' fetchtimeoutsecs: 5 showprogresseverysecs: 10

Options describing

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

Contributing

Any suggestion, feedback or contributing is highly appreciated. Thank you for your support!