Comments (6)
@oscarnevarezleal Yes, I have run it on an EC2 instance. Do you have any questions?
from docker-kafka.
@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.
@flosell That was exactly my problem, thnks!!
from docker-kafka.
@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.
@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.
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)
- cant build docker image
- THE REPO DOESN'T WORK, USE THIS INSTEAD
- Please archive this repo HOT 2
- Docker image tags based on kafka version HOT 3
- Kafka example not working (with 0.10) HOT 2
- Docker-Kafka to get started with topic and produce and consume HOT 1
- Update to Kafka 0.11 HOT 1
- Has anyone been able to start a topic using Docker Compose? HOT 6
- Using this docker in production HOT 2
- Failed to start kafka 'exit status 127' HOT 6
- using dynamic port allocation on docker host
- Increase max client connections
- Cannot publish
- Can you please drop this repo? HOT 1
- Run kafka with an external volume HOT 1
- Unable to change port mappings HOT 2
- You run Kafka and Zookeeper with root permissions... Intended?
- Update to Kafka 2.0.0 HOT 4
- Docker build no longer works HOT 5
- Where's the volume mount option for docker kafka?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-kafka.