Skip to content

Commit 09fd7da

Browse files
committed
2018-03-19 补充 kafka 相关
1 parent a4e73e5 commit 09fd7da

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

markdown-file/Kafka-Install-And-Settings.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,18 @@
2323
- 再添加 kafka 节点:`docker-compose scale kafka=3`
2424
- 停止容器:`docker-compose stop`
2525
- 进入容器:`docker exec -it 54f /bin/bash`
26-
- 容器中 kafka home:`/opt/kafka`
2726
- [spotify/docker-kafka](https://github.com/spotify/docker-kafka)
2827
- Spring 项目选用依赖包的时候,对于版本之间的关系可以看这里:<http://projects.spring.io/spring-kafka/>
2928
- 目前(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`
3038

3139
## 资料
3240

0 commit comments

Comments
 (0)