Code Monkey home page Code Monkey logo

Comments (6)

mjgpy3 avatar mjgpy3 commented on June 25, 2024

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

from docker-kafka.

flosell avatar flosell commented on June 25, 2024

@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.

from docker-kafka.

oscarnevarezleal avatar oscarnevarezleal commented on June 25, 2024

@flosell That was exactly my problem, thnks!!

from docker-kafka.

chorsnell avatar chorsnell commented on June 25, 2024

@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
...

from docker-kafka.

oscarnevarezleal avatar oscarnevarezleal commented on June 25, 2024

@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"
`

from docker-kafka.

aaparella avatar aaparella commented on June 25, 2024

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?

from docker-kafka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.