kzdgt Blog

路在脚下,心向远方

kafka学习笔记

kafka学习笔记

安装 使用docker-compose部署kafka和zookeeper version: '3' services: zoo1: image: wurstmeister/zookeeper ports: - "2181:2181" hostname: zoo1 container_name: zookeeper kafka: image: wurstmeister/kafka depends_on: - zoo1 ports: - "9092:9092" environment: KAFKA_ADVERTISED_HOST_NAME: 114.116.21.20 KAFKA_CREATE_TOPICS: "sun:1:1" KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_BROKER_ID: 1 KAFKA_ZOOKEEPER_CONNECT: zoo1:2181 container_name: kafka