Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Does anyone successfully used this on AWS? #50

Closed
oscarnevarezleal opened this issue Aug 10, 2016 · 6 comments
Closed

Does anyone successfully used this on AWS? #50

oscarnevarezleal opened this issue Aug 10, 2016 · 6 comments

Comments

@oscarnevarezleal
Copy link

Does anyone successfully used this on AWS?

@mjgpy3
Copy link

mjgpy3 commented Aug 25, 2016

@oscarnevarezleal Yes, I have run it on an EC2 instance. Do you have any questions?

@flosell
Copy link

flosell commented Sep 30, 2016

@oscarnevarezleal Are you maybe trying to run this on a memory-constrained instance?
I just found your issue trying to find out why kafka was crashing immediately after start when I deployed the container in a t2.nano instance but was working fine on my laptop.

Turns out, the container by default starts a JVM with -Xmx1G -Xms1G so the t2.nano instance just wasn't big enough. Moving to a bigger instance (t2.small) solved the issue for me. You can also set KAFKA_HEAP_OPTS to something like "-Xmx250m -Xms250m" if you are comfortable running with less memory.

@oscarnevarezleal
Copy link
Author

@flosell That was exactly my problem, thnks!!

@chorsnell
Copy link

@mjgpy3 / @oscarnevarezleal / @flosell

How do you handle the ADVERTISED_HOST? I am using mine on EC2 but via ECS, so I can't be sure which instance it will be under.

In my local dev environment, I have to specify the IP like

  kafka:
    image: spotify/kafka
    hostname: kafka
    environment:
    - ADVERTISED_HOST=192.168.xxx.xxx
...

@oscarnevarezleal
Copy link
Author

oscarnevarezleal commented May 18, 2017

@poppahorse ADVERTISED_HOST should be setted with EC2´s public IP ( not a subnet IP )

Please note that AWS could ( might, most likely ) change your EC2 public IP without warning you so.

If you launch your container with a fixed ADVERTISED_HOST env, this would stop working from one moment to another. What I do in this cases is to assign a Elastic IP to this particular instance altought I don´t know how to apply ( scale ) same rule with multiple instances.

This is an example of docker-compose.yml using spotify/kafka & confluentinc/cp-kafka-rest togheter.

`---
version: '2'
services:
kafka:
image: spotify/kafka
environment:
ADVERTISED_HOST: YOUR_INSTANCE_PUBLIC_IP
ADVERTISED_PORT: 9092
labels:
- io.confluent.docker.testing=true
ports:
- "9092:9092"
- "2181:2181"

kafka-rest:
image: confluentinc/cp-kafka-rest:latest
environment:
KAFKA_REST_ZOOKEEPER_CONNECT: kafka:2181
KAFKA_REST_HOST_NAME: default-config
labels:
- io.confluent.docker.testing=true
links:
- kafka
ports:
- "8082:8082"
`

@aaparella
Copy link

Having a similar problem to @poppahorse, I think. Using this container in ECS and every time a consumer / producer tries to consume / produce to a topic there's a "LEADER_NOT_AVAILABLE" error message.

I have a producer and the kafka container in the same task, with the producer linked to the kafka instance, and ports 2181 and 9092 exposed on the kafka container. I have the ADVERTISED_HOST environment variable set to the IP of the container instance (I know that's not ideal this is just for proof of concept purposes).

Any advice?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants