zoukankan      html  css  js  c++  java
  • docker-compose启动kafka

    文件如下

    
    
    version: "3"
    services:
       zookeeper:
         image: zookeeper
         container_name: zookeeper
        
         ports: 
          - 2181:2181
         networks:
          - kafkanetwork 
         volumes:
          - zookeeper_data:/data
          - zookeeper_log:/logs
          - zookeeper_datalog:/datalog
          - /etc/localtime:/etc/localtime
         deploy: 
             restart_policy:
                 condition: on-failure 
       kafka:
         image: wurstmeister/kafka
         ports:
          - 9092:9092
         environment:
          KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
          KAFKA_LISTENERS: PLAINTEXT://kafka:9092
          KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092  
          KAFKA_BROKER_ID: 22
         volumes:
           - /etc/localtime:/etc/localtime
           - kafka_config:/opt/kafka/config/
           - kafka_libs:/opt/kafka/libs/
           - kafka_logs:/kafka
         networks: 
           - kafkanetwork
         container_name: kafka
         deploy:  
          restart_policy:
              condition: on-failure
       kafka-manager:
        image: sheepkiller/kafka-manager:latest
        ports: 
         - 9000:9000
        environment:
         ZK_HOSTS: zookeeper:2181
         APPLICATION_SECRET: LETMEIN
         KM_ARGS: -Djava.net.preferIPv4Stack=true
        networks: 
         - kafkanetwork
        deploy:  
          restart_policy:
              condition: on-failure
    networks:
       kafkanetwork:
         external:
            name: kafkanetwork
    
    volumes:
       zookeeper_data: {}
       zookeeper_log: {}
       zookeeper_datalog: {}
       kafka_config: {}
       kafka_libs: {}
       kafka_logs: {}
      
    
  • 相关阅读:
    acwing272. 最长公共上升子序列
    哈夫曼编码简单实现
    Linked List Sorting
    jmeter-线程组
    css-书写规范
    mysql-踩坑记录
    vue-npm install
    css-选择器
    js-process对象
    linux-常用命令
  • 原文地址:https://www.cnblogs.com/zhengyazhao/p/14526548.html
Copyright © 2011-2022 走看看