Git Product home page Git Product logo

Comments (6)

nanounanue avatar nanounanue commented on August 28, 2024 1

I am having the same issue, when I tried to solve it defining KAFKA_ADVERTISED_HOST_NAME and KAFKA_ADVERTISED_PORT in docker-compose.yml it (apparently) worked, but now I am having the problems described in http://stackoverflow.com/questions/35861501/kafka-in-docker-not-working

By the way I am using ubuntu

from kafka-docker.

asnir avatar asnir commented on August 28, 2024

You are welcome to try the proposed solution

from kafka-docker.

nanounanue avatar nanounanue commented on August 28, 2024

@asnir What is the proposed solution if i want to have more than one kafka running?

or if I use docker-compose scale?

from kafka-docker.

wurstmeister avatar wurstmeister commented on August 28, 2024

Hi,

@nanounanue in your SO post your compose file is not correct as far as i can tell:

zookeeper:
  image: wurstmeister/zookeeper
  ports:
    - "2181:2181"

kafka:
  image: wurstmeister/kafka
 # hostname: kafka
  ports:
    - "9092"
  links:
    - zookeeper:zk
  environment:
    KAFKA_ADVERTISED_HOST_NAME: "kafka"
    KAFKA_ADVERTISED_PORT: "9092"
    KAFKA_ZOOKEEPER_CONNECT: "zk:2181"

i.e. the port you get is 0.0.0.0:32768->9092/tcp but you set your advertised port to 9092.

the way the advertised port configuration works is that we either:

in your example you can see that your port is 0.0.0.0:32768->9092/tcp, so setting the advertised port to 9092 won't work.

to fix it, either fix the port i.e.

ports:
    - "9092:9092"

or remove the KAFKA_ADVERTISED_PORT configuration and add the mounting of the docker socket as in https://github.com/wurstmeister/kafka-docker/blob/master/docker-compose-single-broker.yml

in fact, if you simply change KAFKA_ADVERTISED_HOST_NAME in https://github.com/wurstmeister/kafka-docker/blob/master/docker-compose-single-broker.yml
to your ubuntu host IP things should work.

Let me know if this helps.

from kafka-docker.

alexbuce avatar alexbuce commented on August 28, 2024

after the above step the port is accessible outside of the container
if we set the port then
"docker-compose scale kafka=2" is not working. it fails with below error.

Cannot start service kafka: driver failed programming external connectivity on endpoint
How to resolve this?

from kafka-docker.

onieio avatar onieio commented on August 28, 2024

My issue was with the Kafka service, After deleting the pod I forgot to remove the service from the 'kubectl get services --namespace pod_ns'. Once the service removed everything works well.

from kafka-docker.

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.