From 87fdbca3351d7b48d0e43ff234ce728d9a0d0f76 Mon Sep 17 00:00:00 2001 From: Tatyana Koroleva Date: Fri, 2 Jun 2017 13:36:24 +0300 Subject: [PATCH 1/3] update read me initial readme update --- README.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ae4c20c..804498d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,33 @@ # kafka -pykafka client related stuff +Deploy instructions. + +Search for any kafka docker: +- docker search kafka + +Start the zookeeper container, give it a name, bind the container port 2181 to the host OS port so that we can access that port from the our host OS if needed: +- docker run -d -p 2181:2181 --name zookeeper jplock/zookeeper + +Start the Kafka Docker, name it: kafka, link it to the above Zookeeper container: + +- docker run -d --name kafka --link zookeeper:zookeeper ches/kafka + +Get the IP addresses of the Zookeeper and the Kafka broker first. Note that, these IP addresses are assigned for Docker container automatically when we started them: + +- ZK_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' zookeeper) +- KAFKA_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' kafka) + +We will issue the below command to create a topic “test” with 1 partition and 1 replicated: + +Issue below command to produce message to the “test” topic: + +- docker run --rm ches/kafka \ +> kafka-topics.sh --create --topic test --replication-factor 1 --partitions 1 --zookeeper $ZK_IP:2181 +Created topic "test". + +Issue below command to produce message to the “test” topic (The terminal will wait for our input.): + +- docker run --rm --interactive ches/kafka kafka-console-producer.sh --topic test0 --broker-list $KAFKA_IP:9092 +02120152 + + + From 228000c8e77505177fec0c994502de83130b5676 Mon Sep 17 00:00:00 2001 From: Tatyana Koroleva Date: Fri, 2 Jun 2017 13:42:57 +0300 Subject: [PATCH 2/3] update readme added ``` --- README.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 804498d..efcc076 100644 --- a/README.md +++ b/README.md @@ -2,32 +2,42 @@ Deploy instructions. Search for any kafka docker: -- docker search kafka +``` +docker search kafka +``` Start the zookeeper container, give it a name, bind the container port 2181 to the host OS port so that we can access that port from the our host OS if needed: -- docker run -d -p 2181:2181 --name zookeeper jplock/zookeeper +``` +docker run -d -p 2181:2181 --name zookeeper jplock/zookeeper +``` Start the Kafka Docker, name it: kafka, link it to the above Zookeeper container: - -- docker run -d --name kafka --link zookeeper:zookeeper ches/kafka +``` +docker run -d --name kafka --link zookeeper:zookeeper ches/kafka +``` Get the IP addresses of the Zookeeper and the Kafka broker first. Note that, these IP addresses are assigned for Docker container automatically when we started them: -- ZK_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' zookeeper) -- KAFKA_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' kafka) +``` +ZK_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' zookeeper) +KAFKA_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' kafka) +``` We will issue the below command to create a topic “test” with 1 partition and 1 replicated: Issue below command to produce message to the “test” topic: -- docker run --rm ches/kafka \ +``` +docker run --rm ches/kafka \ > kafka-topics.sh --create --topic test --replication-factor 1 --partitions 1 --zookeeper $ZK_IP:2181 Created topic "test". +``` Issue below command to produce message to the “test” topic (The terminal will wait for our input.): - -- docker run --rm --interactive ches/kafka kafka-console-producer.sh --topic test0 --broker-list $KAFKA_IP:9092 +``` +docker run --rm --interactive ches/kafka kafka-console-producer.sh --topic test0 --broker-list $KAFKA_IP:9092 02120152 +``` From 20b65765e036289013f2a13629af852a0bebbc03 Mon Sep 17 00:00:00 2001 From: Tatyana Koroleva Date: Fri, 2 Jun 2017 13:47:31 +0300 Subject: [PATCH 3/3] update readme final readme update , I hope --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index efcc076..dc24824 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# kafka -Deploy instructions. +# Kafka in Docker +## Deploy instructions. Search for any kafka docker: ``` @@ -16,16 +16,14 @@ Start the Kafka Docker, name it: kafka, link it to the above Zookeeper container docker run -d --name kafka --link zookeeper:zookeeper ches/kafka ``` -Get the IP addresses of the Zookeeper and the Kafka broker first. Note that, these IP addresses are assigned for Docker container automatically when we started them: +Get the IP addresses of the Zookeeper and the Kafka broker first. Note that these IP addresses are assigned for Docker container automatically when we started them: ``` ZK_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' zookeeper) KAFKA_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' kafka) ``` -We will issue the below command to create a topic “test” with 1 partition and 1 replicated: - -Issue below command to produce message to the “test” topic: +We will issue the below command to create a topic “test” with 1 partition and replication factor 1: ``` docker run --rm ches/kafka \ @@ -39,5 +37,4 @@ docker run --rm --interactive ches/kafka kafka-console-producer.sh --topic test0 02120152 ``` -