您的位置:首页 > 文旅 > 美景 > 最新火车停运通知今天_竞价推广直通车_seo搜索引擎优化实训_百度竞价搜索

最新火车停运通知今天_竞价推广直通车_seo搜索引擎优化实训_百度竞价搜索

2025/1/6 4:05:21 来源:https://blog.csdn.net/sumengnan/article/details/144842057  浏览:    关键词:最新火车停运通知今天_竞价推广直通车_seo搜索引擎优化实训_百度竞价搜索
最新火车停运通知今天_竞价推广直通车_seo搜索引擎优化实训_百度竞价搜索

先部署zookeeper集群,启动

参考:docker compose部署zookeeper集群-CSDN博客

再部署kafka集群

networks:
  net:
    external: true

services:


  kafka1:
    restart: always
    image: wurstmeister/kafka:2.13_2.8.1
    container_name: kafka1
    hostname: kafka1
    ports:
      - '9092:9092'
    environment:
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper1:2181,zookeeper2:2182,zookeeper3:2183/kafka
      - KAFKA_BROKER_ID=1      
      - KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092
      - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://182.92.152.225:9092
      - ALLOW_PLAINTEXT_LISTENER=yes
      - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=3
      - KAFKA_NUM_PARTITIONS=1
    volumes:
      - /etc/localtime:/etc/localtime
      - /home/sumengnan/apache/kafka/kafka1/data:/kafka/kafka-logs-kafka1
      - /home/sumengnan/apache/kafka/kafka1/logs:/opt/kafka/logs
    networks:
      - net


  kafka2:
    restart: always
    image: wurstmeister/kafka:2.13_2.8.1
    container_name: kafka2
    hostname: kafka2
    ports:
      - '9093:9092'
    environment:
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper1:2181,zookeeper2:2182,zookeeper3:2183/kafka
      - KAFKA_BROKER_ID=2      
      - KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092
      - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://182.92.152.225:9093
      - ALLOW_PLAINTEXT_LISTENER=yes
      - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=3
      - KAFKA_NUM_PARTITIONS=1
    volumes:
      - /etc/localtime:/etc/localtime
      - /home/sumengnan/apache/kafka/kafka2/data:/kafka/kafka-logs-kafka2
      - /home/sumengnan/apache/kafka/kafka2/logs:/opt/kafka/logs
    networks:
      - net


  kafka3:
    restart: always
    image: wurstmeister/kafka:2.13_2.8.1
    container_name: kafka3
    hostname: kafka3
    ports:
      - '9094:9092'
    environment:
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper1:2181,zookeeper2:2182,zookeeper3:2183/kafka
      - KAFKA_BROKER_ID=3      
      - KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092
      - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://182.92.152.225:9094
      - ALLOW_PLAINTEXT_LISTENER=yes
      - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=3
      - KAFKA_NUM_PARTITIONS=1
    volumes:
      - /etc/localtime:/etc/localtime
      - /home/sumengnan/apache/kafka/kafka3/data:/kafka/kafka-logs-kafka3
      - /home/sumengnan/apache/kafka/kafka3/logs:/opt/kafka/logs
    networks:
      - net

  kafka-console-ui:
    restart: always
    image: wdkang/kafka-console-ui:v1.0.10
    container_name: kafka-console-ui
    hostname: kafka-console-ui
    ports:
      - '7766:7766'
    volumes:
      - /etc/localtime:/etc/localtime
      - /home/sumengnan/apache/kafka/kafka-console-ui/data:/app/data
      - /home/sumengnan/apache/kafka/kafka-console-ui/log:/app/log
    networks:
      - net

 其中:KAFKA_ADVERTISED_LISTENERS为外网ip地址

kafka-console-ui为kafka的可视化web界面,访问7676端口。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com