Quotes
Friday, October 11, 2019
Kafka Commands
Subscribe to:
Posts (Atom)
1
|
bin/zookeeper-server-start.sh config/zookeeper.properties
|
1
|
bin/kafka-server-start.sh config/server.properties
|
1
|
bin/kafka-topics.sh --zookeeper localhost:2181 --list
|
1
2
|
hello-topic
my-replicated-topic
|
1
|
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic hello-topic
|
1
|
Created topic "hello-topic".
|
1
|
bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic hello-topic
|
1
2
|
Topic:hello-topic PartitionCount:1 ReplicationFactor:1 Configs:
Topic: hello-topic Partition: 0 Leader: 0 Replicas: 0 Isr: 0
|
1
|
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic hello-topic
|
1
2
3
4
|
topic
Hello
Halo
Salut
|
1
|
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic hello-topic
|
1
2
3
|
Hello
Halo
Salut
|
1
|
bin/kafka-topics.sh --alter --zookeeper localhost:2181 --partitions 11 --topic hello-topic
|
1
2
|
WARNING: If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected
Adding partitions succeeded!
|
1
|
bin/kafka-topics.sh --delete --zookeeper localhost:2181 --topic hello-topic
|
1
|
bin/kafka-topics.sh --alter --zookeeper localhost:2181 --topic kafkatopic --config <key>=<value>
|
1
|
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic hello-topic --config max.message.bytes=128000
|
1
2
3
|
WARNING: Altering topic configuration from this script has been deprecated and may be removed in future releases.
Going forward, please use kafka-configs.sh for this functionality
Updated config for topic "hello-topic".
|
1
|
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic hello-topic --delete-config max.message.bytes
|