openzipkin-attic / docker-zipkin

Docker images for OpenZipkin
Apache License 2.0
689 stars 330 forks source link

Advises use of internal docker hostname on Mac #186

Closed codefromthecrypt closed 6 years ago

codefromthecrypt commented 6 years ago

cc @ImFlog @jeqo

jcchavezs commented 6 years ago

I used this approach in zipkin-php-example for Kafka. Forgot to add a PR in docker-zipkin:

https://github.com/openzipkin/zipkin-php-example/blob/kafka_transport/docker-compose.yml#L8 and this for obtaining the actual address: https://github.com/openzipkin/zipkin-php-example/blob/kafka_transport/composer.json#L20

Den søn. 19. aug. 2018, 16:37 skrev Adrian Cole notifications@github.com:

@adriancole commented on this pull request.

In docker-compose-kafka.yml https://github.com/openzipkin/docker-zipkin/pull/186#discussion_r211105135 :

@@ -12,6 +12,7 @@ services: container_name: kafka-zookeeper environment:

corresponds to your docker machine and your producer's broker list

  • if using a recent version of docker for Mac, set the hostname to host.docker.internal

  • KAFKA_ADVERTISED_HOST_NAME=192.168.99.100

if you aren't using docker-machine (which is probably most people by now), setting an incorrect IP with kafka will result in screenfuls of love cc @openzipkin/devops-tooling https://github.com/orgs/openzipkin/teams/devops-tooling

zipkin | 2018-08-19 14:25:21.346 WARN 1 --- [pool-2-thread-1] o.a.k.c.NetworkClient : [Consumer clientId=consumer-1, groupId=zipkin] Error while fetching metadata with correlation id 135 : {zipkin=LEADER_NOT_AVAILABLE} zipkin | 2018-08-19 14:25:21.454 WARN 1 --- [pool-2-thread-1] o.a.k.c.NetworkClient : [Consumer clientId=consumer-1, groupId=zipkin] Error while fetching metadata with correlation id 136 : {zipkin=LEADER_NOT_AVAILABLE} zipkin | 2018-08-19 14:25:21.562 WARN 1 --- [pool-2-thread-1] o.a.k.c.NetworkClient : [Consumer clientId=consumer-1, groupId=zipkin] Error while fetching metadata with correlation id 137 : {zipkin=LEADER_NOT_AVAILABLE} zipkin | 2018-08-19 14:25:21.669 WARN 1 --- [pool-2-thread-1] o.a.k.c.NetworkClient : [Consumer clientId=consumer-1, groupId=zipkin] Error while fetching metadata with correlation id 138 : {zipkin=LEADER_NOT_AVAILABLE} zipkin | 2018-08-19 14:25:21.779 WARN 1 --- [pool-2-thread-1] o.a.k.c.NetworkClient : [Consumer clientId=consumer-1, groupId=zipkin] Error while fetching metadata with correlation id 139 : {zipkin=LEADER_NOT_AVAILABLE}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openzipkin/docker-zipkin/pull/186#pullrequestreview-147461021, or mute the thread https://github.com/notifications/unsubscribe-auth/AC7sAoegVRhsJsdhIsccrgWiz6VGwSNoks5uSXgugaJpZM4WC_TJ .

--

José Carlos

jeqo commented 6 years ago

We can use multiple listeners to make connections available inside docker compose using container IP, in the local environment using "localhost" and optionally with Docker machine IP. Similar to https://github.com/confluentinc/cp-docker-images/blob/master/examples/cp-all-in-one/docker-compose.yml#L26

I have tested it with Docker Machine (in Linux) here: https://github.com/jeqo/docker-zipkin/commit/e4b0ea82a3029a72356cad6035af869cc77c085d and is working properly: if you connect from outside Docker machine with :29092. (Port 19092 is available in localhost, and 9092 used by the container).

More details about listeners usage: https://rmoff.net/2018/08/02/kafka-listeners-explained/

codefromthecrypt commented 6 years ago

good notes, team Peru ;)

should we keep written as is or flip it? for example make docker machine the exception as opposed to the default?

On Mon, 20 Aug 2018, 05:49 Jorge Quilcate Otoya, notifications@github.com wrote:

We can use multiple listeners to make connections available inside docker compose using container IP, in the local environment using "localhost" and optionally with Docker machine IP. Similar to https://github.com/confluentinc/cp-docker-images/blob/master/examples/cp-all-in-one/docker-compose.yml#L26

I have tested it with Docker Machine (in Linux) here: jeqo@e4b0ea8 https://github.com/jeqo/docker-zipkin/commit/e4b0ea82a3029a72356cad6035af869cc77c085d and is working properly: if you connect from outside Docker machine with

:29092. (Port 19092 is available in localhost, and 9092 used by the container). More details about listeners usage: https://rmoff.net/2018/08/02/kafka-listeners-explained/ — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .
jeqo commented 6 years ago

I'll vote for keeping Docker Machine as exception, as it is easier to have Docker locally, than on VM