Setting up
Create a set of containerized environments to learn how to use and configure K2K.
Found an issue? Feed it back to us at Github, on Slack, Ask Marios or email.
To execute K2K, you must agree to the EULA and secure a free license.
Accept the EULA by setting license.acceptEula to true .
To execute K2K, you must agree to the EULA and secure a free license.
Accept the EULA by setting license.acceptEula to true .
1
2
3
4
Create a topic to be replicated
Use the following command to create a topic named user-topic in the source cluster:
#adds a topic named k2k-example-topic to the source cluster
docker compose exec kafka-source \
./opt/kafka/bin/kafka-topics.sh \
--create \
--topic user-topic \
--partitions 5 \
--bootstrap-server 127.0.0.1:9092 5
6
Add data to the source cluster
To view replicated data, open two terminal windows and execute these commands separately. The first terminal will show new data appearing in the target cluster topic.
# terminal 1: read replicated topic data
docker compose exec kafka-target \
/opt/kafka/bin/kafka-console-consumer.sh \
--bootstrap-server localhost:9099 \
--topic user-topic \
--property print.key=true \
--property key.separator=, \
--from-beginning#terminal 2: add data to the source topic
docker-compose exec kafka-source \
./opt/kafka/bin/kafka-producer-perf-test.sh \
--topic user-topic \
--num-records 100 \
--record-size 20 \
--throughput -1 \
--producer-props bootstrap.servers=localhost:9092Last updated
Was this helpful?

