Closed michael-s-grant closed 7 years ago
Looks like you are using docker-java
implementation on MacOS. Sorry, I have different environment setup these days. I'd recommend trying Spotify-based executor, at very least in that case I might be able to reproduce your steps
@michael-s-grant Hi, are you still having this problem?
I've got an environment similar to yours, and can maybe help. One thing that caught my eye is the val KafkaAdvertisedHost = "192.168.99.100"
. With macOS and docker-machine
, this is often so but not necessarily always.
What do you get with:
$ docker-machine ip
192.168.99.100
@akauppi Thanks for your feedback. In response to your first question, since we needed something working back in October, I implemented a considerably more verbose and less elegant solution in Java instead. Now, we're moving towards getting Maven to run Docker containers for our system tests rather than have them started by the tests themselves, so we're less likely to be in this situation again; but it would still be good to know how to solve this problem, just in case.
And in response to your second question, the docker-machine is 192.168.99.100, in my case (though the command you suggested gives me an error "Error getting IP address: Something went wrong running an SSH command!", but this is demonstrably not critical as everything else I do to access the machine via this address, including the abovementioned Java workaround, works fine).
@michael-s-grant I think it'd be better for you to move your example to a real test that we can just copy and paste in. The example is incomplete, since you don't have zookeeper at all, and the container will certainly die given that it can't register with zookeeper. You may have zookeeper running from outside via docker run
, but it's still much easier to reproduce given a full test.
I've just made working example for Kafka. https://github.com/viktortnk/docker-testkit-examples Closing as there is no activity in this thread
Hi. I'm much attracted to your way of running Docker containers; it's elegant, and vastly simpler than the equivalent in Java which I have to hand. The only problem is that it doesn't work, for me. The test example I've reduced my code to is so simple that I suspect the error may be in your code, not mine.
Here's my code, which I'm running with Scala 2.11.8 on a Mac running El Capitan:
I was using 0.8.3 of your code, but upgrading to 0.9.0-M5 also reproduces the problem.
Running
docker run spotify/kafka
at the command line shows the container does start, and the expected string is produced; however running the above Scala results in:with no further explanation.
Setting logging to debug gives me, inter alia the following, which hasn't particularly shed light for me:
...following which there is a DELETE request to https://192.168.99.100:2376/containers/6de0e43452a10b117f3ed713dcad961b436a9185bb497f4b915318c8b071480c?v=true&force=true and the nascent container is then deleted.
By chance, #48 appeared whilst I was in the middle of getting very confused trying to step-debug the code, so I tried including
.withLogLineReceiver (LogLineReceiver (true, (s : String) => println ("*** " + s) ))
, with a version of your code with the changes from that PR included, to examine the container log, but nothing turned up.Having now exhausted my ideas, and, so Google would suggest, also the wider Internet's prior experience, can I turn this over to you to investigate, please?