1. 下载
https://kafka.apache.org/downloads
解压压缩包,以/root/kafka
为例
2. 启动zk
/root/kafka/bin/zookeeper-server-start.sh /root/kafka/config/zookeeper.properties
3. 启动broker
/root/kafka/bin/kafka-server-start.sh /root/kafka/config/server.properties
4. docker方式安装kakfa-ui
github: https://github.com/provectus/kafka-ui
doc: https://docs.kafka-ui.provectus.io/overview/readme
首先在 ~/kui
目录下创建两个文件:
config.yml
kafka:
clusters:
- name: local
bootstrapServers: 172.17.0.1:9092
metrics:
port: 9997
type: JMX
dynamicConfig:
enabled: true
docker-compose-kui.yml
services:
kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
ports:
- "8080:8080"
environment:
DYNAMIC_CONFIG_ENABLED: 'true'
volumes:
- ~/kui/config.yml:/etc/kafkaui/dynamic_config.yaml
创建完毕后,输入命令:
docker compose -f docker-compose.yml up -d
注意:不是docker-compose
而是 docker compose
。
docker container启动后进入8080端口查看结果: