- Make a new cloud instance with ports 2181 and 9092 open.
- Install Docker and Docker-Compose
$ curl -sSL https://get.docker.com | sh $ sudo curl -L https://github.com/docker/compose/releases/download/1.23.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose $ sudo chmod +x /usr/local/bin/docker-compose
- Clone this repo:
$ git clone https://github.com/wurstmeister/kafka-docker
- In
docker-compose-single-broker.yml
, setKAFKA_ADVERTISED_HOST_NAME
to be the IP of your instance. - Launch the Kafka app with Docker Compose
$ docker-compose -f docker-compose-single-broker.yml up -d
That's it.
You can run test it with kafkacat
(after brew install kafkacat
):
Produce:
$ kafkacat -P -b your-instance-ip:9092 -P -t test
Consume:
$ kafkacat -P -b your-instance-ip:9092 -C -t test