-
Set the KAFKA_ADVERTISED_HOST_NAME for your machine
on Mac run % export EXTERNAL_IP=$(ifconfig en0 | awk '/inet / {print $2}')
-
Execute docker-compose and scale
[sudo] docker-compose up -d [sudo] docker-compose scale kafka=3
-
Log in to an instance and verify
[sudo] docker exec -i -t springbootkafka_kafka_1 /bin/bash
-
Create a topic
Note
|
unset JMX_PORT since it conflicts when running these commands: |
$KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper zk:2181 --replication-factor 1 --partitions 1 --topic test
$KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper zk:2181 --replication-factor 3 --partitions 100 --topic topic3-100