-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not works on Docker Mac Native - Zookeeper timeouts #110
Comments
Most likely the broker's advertised IP address is incorrect. I use an environment variable, DOCKER_HOST_IP, to use my Mac's public IP address as the KAFKA_ADVERTISED_HOST_NAME value. Here are the relevant snippets from my scripts: … #
# Set the docker-compose.yml variable
#
if [[ -z "${DOCKER_HOST_IP-}" ]]; then
docker_host_ip=$(docker run --rm --net host alpine ip address show eth0 | awk '$1=="inet" {print $2}' | cut -f1 -d'/')
# Work around Docker for Mac 1.12.0-rc2-beta16 (build: 9493)
if [[ $docker_host_ip = '192.168.65.2' ]]; then
docker_host_ip=$(/sbin/ifconfig | grep -v '127.0.0.1' | awk '$1=="inet" {print $2}' | cut -f1 -d'/' | head -n 1)
fi
export DOCKER_HOST_IP=$docker_host_ip
fi
echo '==> building environment'
docker-compose build --pull
echo '==> launching environment'
docker-compose up -d … … kafka:
image: wurstmeister/kafka:0.9.0.1
links:
- zookeeper:zk
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: "${DOCKER_HOST_IP}"
KAFKA_ZOOKEEPER_CONNECT: zk
volumes:
- /var/run/docker.sock:/var/run/docker.sock … |
@jonbuffington where do you place your .bash code? Thank you. |
@VatslavDS I created a script, |
Can you share bootstrap.sh file please? |
@jonbuffington Your script is truncated in some weird way, so the awk command terminates too early. If you'd upload, that would be pretty cool. |
@VatslavDS @sanear I updated the above comment with abbreviated content of the script. |
@jonbuffington I've already updated my boot.sh to your code, however when I try to publish and suscribe to that, it doesn't work (Even nor an error). Could you share your full docker-compose.yml ? Thank you. |
Hi all. I had some problems switching to the new mac native docker and found that --net=host is not working as I expected. For Zookeeper, there's 3 I hope that's on point for this problem and saves everyone some grief. |
@jonbuffington @VatslavDS @mmullis I find that nothing proposed here works. My full
What sense does it make to set |
To fix this issue you can use the docker.for.mac.localhost as mentioned above. Then in your start-kafka-shell.sh add a --net=kafkadocker_default option to the docker command. Now you can use the service names 'kafka' and 'zookeeper' instead of the IP addresses in the script arguments. See the PR #274 |
It looks like user error from the original question
This looks like trying to use the What i'd actually expect this command to look like is
where the IP addresses used need to be routable from the new container. I'll add this information to the tutorial. |
@sbgreene1307 I've tried your PR and instructions, however, I'm getting the following error when running the shell scripts:
Any clues as to what might be wrong? Thanks! |
@nWidart It looks like the wurstmeister/kafka-docker changed the docker network name to But you should keep in mind that my PR was rejected. Yes it is a workaround, but should be avoided for any production usage. |
Thank you for your quick response! It seems like I'm getting the same issue with the dash: I can't seem to find any reference to Indeed I saw the responses in the pull request. This is just for local development as an experiment, so nothing production worthy 😄 |
@nWidart - have you read the connectivity guide. I think if you're having a specific issue with the image it would be best to open a new issue with the steps you have taken, commands you have used, versions of docker / docker-compose / host os etc. As the issue is quite old, and only kept open for documentation, i'll open a new ticket to track the documentation issue and close this one. |
subsumed by #407 |
I'm using Docker Native with 6GB RAM, 2CPU Core.
kafka_2.11-0.10.0.0, zookeeper-3.4.6
I try make steps in help for testing.
Any idea why this not work?
It's some simple test for zookeeper how check if works correctly?
IP Addresses are from
docker inspect
The text was updated successfully, but these errors were encountered: