-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path0_topic.sh
More file actions
24 lines (17 loc) · 908 Bytes
/
0_topic.sh
File metadata and controls
24 lines (17 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Login kafka1 container
docker exec -it kafka1 /bin/bash
# Create the first topic
## topic name should contain - instead of _
kafka-topics.sh --bootstrap-server localhost:9092 --create --topic first-topic --partitions 3
# List topics
kafka-topics.sh --bootstrap-server localhost:9092 --list
# Create the second topic
kafka-topics.sh --bootstrap-server localhost:9092 --create --topic second-topic --partitions 3 --replication-factor 3
kafka-topics.sh --bootstrap-server localhost:9092 --create --topic third-topic --partitions 5 --replication-factor 2
# List topics
kafka-topics.sh --bootstrap-server localhost:9092 --list
# Describe topics
kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic first-topic
kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic second-topic
# Delete topics
kafka-topics.sh --bootstrap-server localhost:9092 --delete --topic third-topic