-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommands
25 lines (16 loc) · 1018 Bytes
/
Commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Start Producer:
./kafka-console-producer --broker-list localhost:9095 --producer.config ../etc/kafka/^Coducer.properties --topic test1
Start Consumers:
./kafka-console-consumer --bootstrap-server localhost:9095 --consumer.config ../etc/kafka/consumer.properties --topic test1 --from-beginning
Create Topics
./kafka-topics --zookeeper localhost:2181 ^Ccreate --topic test1 --partitions 1 --replication-factor 1
List topics:
./kafka-topics --zookeeper localhost:2181 --list
delete topics:
./kafka-topics --zookeeper localhost:2181 --delete --topic logs
Note: in order to delete the topics permanently , we need to enable the below property in server.properties.
# Switch to enable topic deletion or not, default value is false
delete.topic.enable=true
Describe a topic: ./kafka-topics --describe --zookeeper localhost:2181 --topic tibtopic2
alter a topic
/kafka-topics --alter --zookeeper localhost:2181 --topic tibtopic2 --partitions 3