Uber uReplicator https://github.com/uber/uReplicator dockerized
381
uReplicator provides the ability to replicate across Kafka clusters in other data centers. Instead of publishing to a single Kafka cluster, you can publish data to multiple regional Kafka clusters and aggregate it all in one Kafka cluster.
=========
Kafka's current (part of 0.8.2) MirrorMaker design consumes data from a given regional Kafka cluster using a Kafka high-level consumer. With this design, rebalancing in the high level consumer (due to a addition/deletion of topics, source cluster problems, network issues and so on) affects all the topics being replicated via that Mirrormaker.
Check out the uReplicator project:
git clone [email protected]:uber/uReplicator.git
cd uReplicator
This project contains everything (both mirrormaker-controller and mirrormaker-worker) you’ll need to run uReplicator.
Before you can run uReplicator, you need to build a package for it. This package is what your deployment tool uses to deploy uReplicator.
mvn clean package
Or command below (the previous one will take a long time to run):
mvn clean package -DskipTests
To test uReplicator locally, you need two systems: Kafka, and ZooKeeper. The script “grid” is to help you set up these systems.
chmod u+x bin/pkg/*.sh
bin/grid bootstrap
./bin/produce-data-to-kafka-topic-dummyTopic.sh
./deploy/kafka/bin/kafka-console-consumer.sh --zookeeper localhost:2181/cluster1 --topic dummyTopic
Kafka topic dummy topic data 1
Kafka topic dummy topic data 2
Kafka topic dummy topic data 3
Kafka topic dummy topic data 4
…
Example 1: Copy data from source cluster to destination cluster
./uReplicator-Distribution/target/uReplicator-Distribution-pkg/bin/start-controller-example1.sh
./uReplicator-Distribution/target/uReplicator-Distribution-pkg/bin/start-worker-example1.sh
curl -X POST -d '{"topic":"dummyTopic", "numPartitions":"1"}' http://localhost:9000/topics
./deploy/kafka/bin/kafka-console-consumer.sh --zookeeper localhost:2181/cluster2 --topic dummyTopic1
Kafka topic dummy topic data 1
Kafka topic dummy topic data 2
Kafka topic dummy topic data 3
Kafka topic dummy topic data 4
…
Example 2: Copy data from source Kafka to destination Kafka cluster without explicitly whitelisting topics
./uReplicator-Distribution/target/uReplicator-Distribution-pkg/bin/start-controller-example2.sh
./uReplicator-Distribution/target/uReplicator-Distribution-pkg/bin/start-worker-example2.sh
./deploy/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181/cluster2 --topic dummyTopic --partition 1 --replication-factor 1
./deploy/kafka/bin/kafka-console-consumer.sh --zookeeper localhost:2181/cluster2 --topic dummyTopic
Kafka topic dummy topic data 1
Kafka topic dummy topic data 2
Kafka topic dummy topic data 3
Kafka topic dummy topic data 4
…
When you’re done, you can clean everything up using the same grid script:
./bin/pkg/stop-all.sh
Congratulations! You’ve now set up a local grid that includes Kafka and ZooKeeper, and you've run a uReplicator worker on it.
Content type
Image
Digest
Size
636.4 MB
Last updated
over 8 years ago
docker pull balboah/ureplicator