File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 23
23
- 再添加 kafka 节点:`docker-compose scale kafka=3`
24
24
- 停止容器:`docker-compose stop`
25
25
- 进入容器:`docker exec -it 54f /bin/bash`
26
- - 容器中 kafka home:`/opt/kafka`
27
26
- [spotify/docker-kafka](https://github.com/spotify/docker-kafka)
28
27
- Spring 项目选用依赖包的时候,对于版本之间的关系可以看这里:<http://projects.spring.io/spring-kafka/>
29
28
- 目前(201803) spring-kafka 必须是 2.1.x 才能对应 kafka 1.0.x
29
+ - 官网 quickstart 指导:< https://kafka.apache.org/quickstart >
30
+ - 常用命令:
31
+ - 容器中 kafka home:`/opt/kafka`
32
+ - 我的 zookeeper 地址:`10.135.157.34:2181`,有多个节点用逗号隔开
33
+ - 列出所有 topic:`bin/kafka-topics.sh --list --zookeeper 10.135.157.34:2181`
34
+ - 创建 topic:`bin/kafka-topics.sh --create --topic kafka-test-topic-1 --partitions 3 --replication-factor 1 --zookeeper 10.135.157.34:2181`
35
+ - 创建名为 kafka-test-topic-1 的 topic,3个分区分别存放数据,数据备份总共 2 份
36
+ - 查看特定 topic 的详情:`bin/kafka-topics.sh --describe --topic kafka-test-topic-1 --zookeeper 10.135.157.34:2181`
37
+ - 删除 topic:`bin/kafka-topics.sh --delete --topic kafka-test-topic-1 --zookeeper 10.135.157.34:2181`
30
38
31
39
## 资料
32
40
You can’t perform that action at this time.
0 commit comments