From 8a3dca6b8b7cefe2212cbc31840a049e95406324 Mon Sep 17 00:00:00 2001 From: "wenxue.liu" <1234qwer> Date: Thu, 5 Apr 2018 17:07:12 +0800 Subject: [PATCH 1/2] modify gitignore and kafka-debug Dockfile --- .gitignore | 3 +++ examples/wordcount/docker/kafka-debug/Dockerfile | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7ac8981..63fd316 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,6 @@ ENV/ # Vagrant .vagrant/ + +#mac os DS_Store +.DS_Store diff --git a/examples/wordcount/docker/kafka-debug/Dockerfile b/examples/wordcount/docker/kafka-debug/Dockerfile index bcc7881..acdb68e 100644 --- a/examples/wordcount/docker/kafka-debug/Dockerfile +++ b/examples/wordcount/docker/kafka-debug/Dockerfile @@ -5,14 +5,15 @@ ENV SCALA_VERSION 2.11 ENV KAFKA_VERSION 0.10.1.0 ENV KAFKA_HOME /opt/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION" + # Install Kafka and other needed things RUN apt-get update && \ apt-get install -y wget dnsutils && \ rm -rf /var/lib/apt/lists/* && \ apt-get clean && \ - wget -q http://apache.mirrors.spacedump.net/kafka/"$KAFKA_VERSION"/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION".tgz -O /tmp/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION".tgz && \ + wget -q http://archive.apache.org/dist/kafka/"$KAFKA_VERSION"/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION".tgz -O /tmp/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION".tgz && \ tar xfz /tmp/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION".tgz -C /opt && \ rm /tmp/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION".tgz -CMD ["/opt/kafka_2.11-0.10.1.0/bin/kafka-console-consumer.sh","--bootstrap-server","kafka:9092","--topic","wks-wordcount-example-count","--from-beginning","--property","print.key=true"] +CMD ["$KAFKA_HOME/bin/kafka-console-consumer.sh","--bootstrap-server","kafka:9092","--topic","wks-wordcount-example-count","--from-beginning","--property","print.key=true"] From 1ba9d35e89e3fbcdceaf3fef6878aff791fb0ac9 Mon Sep 17 00:00:00 2001 From: "wenxue.liu" <1234qwer> Date: Sat, 14 Apr 2018 15:23:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9docker=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/wordcount/docker/docker-compose.yml | 6 +++--- examples/wordcount/docker/kafka-debug/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/wordcount/docker/docker-compose.yml b/examples/wordcount/docker/docker-compose.yml index 4a97ddb..5f85440 100644 --- a/examples/wordcount/docker/docker-compose.yml +++ b/examples/wordcount/docker/docker-compose.yml @@ -18,21 +18,21 @@ services: - kafka kafka: image: "spotify/kafka" - hostname: kafka + hostname: localhost ports: - 2181:2181 - 9092:9092 - 7203:7203 environment: - JMX_PORT=7203 - - ADVERTISED_HOST=kafka + - ADVERTISED_HOST=localhost - ADVERTISED_PORT=9092 kafka-manager: image: "sheepkiller/kafka-manager" ports: - 9000:9000 environment: - - ZK_HOSTS=kafka:2181 + - ZK_HOSTS=localhost:2181 - APPLICATION_SECRET=letmein kafka-debug: build: diff --git a/examples/wordcount/docker/kafka-debug/Dockerfile b/examples/wordcount/docker/kafka-debug/Dockerfile index acdb68e..3bbb891 100644 --- a/examples/wordcount/docker/kafka-debug/Dockerfile +++ b/examples/wordcount/docker/kafka-debug/Dockerfile @@ -16,4 +16,4 @@ RUN apt-get update && \ rm /tmp/kafka_"$SCALA_VERSION"-"$KAFKA_VERSION".tgz -CMD ["$KAFKA_HOME/bin/kafka-console-consumer.sh","--bootstrap-server","kafka:9092","--topic","wks-wordcount-example-count","--from-beginning","--property","print.key=true"] +CMD ["$KAFKA_HOME/bin/kafka-console-consumer.sh","--bootstrap-server","localhost:9092","--topic","wks-wordcount-example-count","--from-beginning","--property","print.key=true"]