Skip to content

Instantly share code, notes, and snippets.

@joshuacook
Created November 5, 2018 21:17
Show Gist options
  • Save joshuacook/cc4ab15ddab7159abb7a5ce962943803 to your computer and use it in GitHub Desktop.
Save joshuacook/cc4ab15ddab7159abb7a5ce962943803 to your computer and use it in GitHub Desktop.
  1. Make a new cloud instance with ports 2181 and 9092 open.
  2. 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
    
  3. Clone this repo:
    $ git clone https://github.com/wurstmeister/kafka-docker
    
  4. In docker-compose-single-broker.yml, set KAFKA_ADVERTISED_HOST_NAME to be the IP of your instance.
  5. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment