Posts

Showing posts with the label Kafka Linux command

Kafka commands

 Producer console ./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic testTopic --partition 0 Consumer console ./bin/kafka-console-consumer.sh --broker-list localhost:9092 --topic testTopic --partition 0 Describe a topic ./bin/kafka-topic.sh --describe --zookeeper localhost:2181 --topic <topicName> Broker Version ./bin/kafka-broker-api-versions --bootstrap-server localhost:9092 --version Create a topic  /bin/kafka-topics.sh --zookeeper $ZK_HOSTS --create --topic $TOPIC_NAME --partitions 3 --replication-factor 3 Create a topic if it doesn't exist /bin/kafka-topics.sh --zookeeper $ZK_HOSTS --create --topic $TOPIC_NAME --partitions 3 --replication-factor 3 --if-not-exists List brokers ./usr/bin/kafka-topics --zookeeper zookeeper:2181 --list Show Kafka topic details ./usr/bin/kafka-topics --zookeeper zookeeper:2181 --topic my-first-topic --describe Increase partitions in the topic ./usr/bin/kafka-topics --zookeeper zookeeper:2181 --alter --topic my-first-top...