-
Notifications
You must be signed in to change notification settings - Fork 645
Minor update to README #38
Comments
What I have noticed, running spotify/kafka docker instance behind corporate firewall is that posting messages to topic using Since inside the docker image Then everything worked well. Hope you could put this comment somewhere on wiki or some place. This is not mentioned anywhere and it was through try /error that I stumbled on this. THis is only for situations where you are running docker behind corporate firewall and need to forward all request using VM port forwarding. |
Thanks for comment, @tuhingupta ! In particular, using Docker will modify the If you do run the "producer" from your dev box (eg, laptop) then, obviously, you need a way to reach the VM's IP (depending on what you are using, whether Virtualbox or the newer Docker for Mac/Windows, there are different ways to reach it). Again, I'm not sure how Kafka is going to use |
Note if you are using docker-compose, and are expecting ADVERTISED_HOST of "kafka" to work if you have a service called "kafka", it won't. docker-compose doesn't add the service's own name to hosts. You can set hostname in docker-compose.yml though, and use that for ADVERTISED_HOST. e.g.:
|
1+ |
This is what you should do if you want to talk to kafka from another container Run Kafka:
Run Kafka Consumer:
Run Kafka Producer:
This is what you should do if you want to talk to kafka from localhost
Run Kafka Consumer (you must run this on your localhost machine, not using docker run):
Run Kafka Producer (you must run this on your localhost machine, not using docker run):
|
ran this: ran this: ERROR: Ran this: result: Not sure where to go now... |
@SquirrelNinja it appears that $KAFKA_HOME is not being expanded for you, this is the error I usually get if the path is wrong:
|
@arianitu - you are correct, I put the whole path in and it was fine - thx! |
@SquirrelNinja my best guess is that you are missing a FWIW - I prefer to use |
BTW - as this project seems 'abandoned" to me (there are 22 PR's pending) I have forked my own, which also has been recently updated to run Kafka 0.10.1.1. |
@massenz - thanks! |
Hey guys,
super-thanks for creating this, saved me a TON of time!
I just noticed that the instructions in the README may be slightly improved, by using the following (I was having trouble running this on a VM where I hadn't installed Kafka, so wanted to run both consumer/producer inside two separate containers, still using this image - but avoid using the "hack" of using
localhost
everywhere).I also believe that Kafka will have trouble if the
ADVERTISED_HOST
does not reflect the IP of the container.Anyways, this is how I ran it - please let me know if you would like me to update the README and I'd be happy to submit a PR.
To launch the Producer (this used to fail with a
kafka.common.LeaderNotAvailableException
when posting to a topic):similarly, the consumer can be run with:
Also, I would suggest adding the
/opt/kafka_xxx
directory to the container'sPATH
in theDockerfile
(again, happy to send a PR, if you guys want me to).Hope this helps!
The text was updated successfully, but these errors were encountered: