启动kafka

启动 kafka

启动 kafka 使用 zookeeper

shell 复制代码
# 启动 zookeeper
./zookeeper-server-start.sh ../config/zookeeper.properties &
# 启动 kafka
./kafka-server-start.sh ../config/server.properties &

# 关闭 kafka
./kafka-server-stop.sh ../config/server.properties

# 关闭 zookeeper
./zookeeper-server-stop.sh ../config/zookeeper.properties

使用独立 zookeeper 启动 kafka

shell 复制代码
# 启动 zookeeper
./zkServer.sh start

# 启动 kafka
./kafka-server-start.sh ../config/server.properties &

使用 KRaft 启动 kafka

shell 复制代码
# 生成 cluster UUID 生成的 UUID 为:tlR2hHI6S9eFbAkkkFYveQ
./kafka-storage.sh random-uuid

# 格式化日志目录 -t 参数的值为上面生成的 UUID: tlR2hHI6S9eFbAkkkFYveQ
./kafka-storage.sh format -t tlR2hHI6S9eFbAkkkFYveQ -c ../config/kraft/server.properties

# 启动 kafka
./kafka-server-start.sh ../config/kraft/server.properties &

# 关闭 kafka
./kafka-server-stop.sh ../config/kraft/server.properties

使用 Docker 启动 kafka

shell 复制代码
# 拉取 kafka 镜像
docker pull apache/kafka:3.7.0

# 启动 kafka
docker -d --name kafka -p 9092:9092 --restart=always apache/kafka:3.7.0
相关推荐
分布式存储与RustFS1 天前
MinIO 官方 Docker 镜像被移除:依赖它的项目该怎么办
docker·云原生·devops·对象存储·minio·分布式存储
玉&心1 天前
通过Arthas在线诊断K8S中的内存及JVM等使用情况
docker·k8s·arthas
xing-xing1 天前
Docker容器中Nginx站点根目录网页配置访问
nginx·docker
guo_wen_qiang1 天前
上传本地镜像到harbor中
docker·容器·持续部署
羑悻的小杀马特1 天前
Dockerfile 全景指南:从入门编写dockerfile到生产环境镜像优化实战,一步步带你从啃透制作指令到镜像制作落地!
docker·dockerfile·镜像制作
BianHuanShiZhe1 天前
docker常见命令
docker
Thomas.Sir1 天前
第21课:PyTorch|GPU多卡训练与分布式训练基础【让多卡并行成为你的加速引擎】
人工智能·pytorch·分布式
Cicada1281 天前
库存消息消费的正确性设计——从幂等窗口到批量流水线
分布式·系统架构
正经教主1 天前
【FDE系列】阶段2:Day 43:Docker Compose — 多容器一键编排
人工智能·docker·fde
Nano叶落1 天前
Kafka 消费积压排查入门:Docker 搭环境亲手制造一次 ‘消息堵死‘,10 分钟看懂 Lag
kafka