@@ -1,58 +0,0 @@ Kafka - 安装 | 凤凰涅槃进阶之路

Kafka - 安装

Abel sun2022年12月24日
约 262 字小于 1 分钟

Kafka - 安装

1. 安装

1.1 docker-compose 安装

1.1.1 docker-compose.yml 编写

version: '3'

services:
  zookeeper:
    image: 'bitnami/zookeeper:3.8.0'
    container_name: zookeeper
    ports:
      - "2181:2181"
    environment:
      TZ: Asia/Shanghai
      ALLOW_ANONYMOUS_LOGIN: "yes"
      ZOO_SERVER_ID: 1
      ZOO_PORT_NUMBER: 2181
    # network_mode: "host"

  kafka:
    image: 'bitnami/kafka:3.2.0'
    container_name: kafka
    ports:
      - "9092:9092"
    environment:
      TZ: Asia/Shanghai
      # 更多变量 查看文档 https://github.com/bitnami/bitnami-docker-kafka/blob/master/README.md
      KAFKA_BROKER_ID: 1
      # 监听端口
      KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
      # 实际访问ip 本地用 127 内网用 192 外网用 外网ip
      KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://192.168.31.165:9092
      KAFKA_CFG_ZOOKEEPER_CONNECT: 127.0.0.1:2181
      ALLOW_PLAINTEXT_LISTENER: "yes"
    volumes:
      - ./data:/bitnami/kafka/data
    depends_on:
      - zookeeper
    #network_mode: "host"

  kafka-manager:
    image: sheepkiller/kafka-manager:latest
    container_name: kafka-manager
    ports:
      - "19092:19092"
    environment:
      ZK_HOSTS: 127.0.0.1:2181
      APPLICATION_SECRET: letmein
      KAFKA_MANAGER_USERNAME: ruoyi
      KAFKA_MANAGER_PASSWORD: ruoyi123
      KM_ARGS: -Dhttp.port=19092
    depends_on:
      - kafka
    #network_mode: "host"

1.1.2 启动

docker-compose up -d

2. 控制台管理

2.1 进入控制台

http://localhost:19092/open in new window

image-20220922133836608

2.2 创建集群链接

image-20220922133941643

image-20220922134027419

2.3 添加List

image-20220922134525592

2.4 查看

image-20220922134557163

参考文章

docker-compose 安装 Kafka 3.X 附带可视化界面open in new window

评论
  • 按正序
  • 按倒序
  • 按热度
Powered by Waline v2.9.1