From cfdf2756f162c469985ed0097ae205be99d91349 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Tue, 6 Sep 2016 06:21:55 +0200 Subject: Clarifies commands around the second test topic, and what a topic name typo leads to --- test/test.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/test.sh b/test/test.sh index 244580e..bfc4a8f 100644 --- a/test/test.sh +++ b/test/test.sh @@ -1,7 +1,4 @@ -# Run ls ./bin here to see the toolbox -kubectl exec -ti testclient -- /bin/bash - # List topics kubectl exec testclient -- ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --list @@ -18,13 +15,19 @@ kubectl exec -ti testclient -- ./bin/kafka-console-producer.sh --broker-list kaf # Bootstrap even if two nodes are down (shorter name requires same namespace) kubectl exec -ti testclient -- ./bin/kafka-console-producer.sh --broker-list kafka-0.broker:9092,kafka-1.broker:9092,kafka-2.broker:9092 --topic test1 +# The following commands run in the pod +kubectl exec -ti testclient -- /bin/bash + # Topic 2, replicated -./bin/kafka-topics.sh --zookeeper zookeeper:2181 --describe --topic topic2 +./bin/kafka-topics.sh --zookeeper zookeeper:2181 --describe --topic test2 ./bin/kafka-verifiable-consumer.sh \ --broker-list=kafka-0.broker.kafka.svc.cluster.local:9092,kafka-1.broker.kafka.svc.cluster.local:9092 \ - --topic=topic2 --group-id=A --verbose + --topic=test2 --group-id=A --verbose +# If a topic isn't available this producer will tell you +# WARN Error while fetching metadata with correlation id X : {topicname=LEADER_NOT_AVAILABLE} +# ... but with current config Kafka will auto-create the topic ./bin/kafka-verifiable-producer.sh \ --broker-list=kafka-0.broker.kafka.svc.cluster.local:9092,kafka-1.broker.kafka.svc.cluster.local:9092 \ --value-prefix=1 --topic=test2 \ -- cgit v1.2.3