diff --git a/cmak/docker-compose.yml b/cmak/docker-compose.yml index 76e3485..c6257ef 100644 --- a/cmak/docker-compose.yml +++ b/cmak/docker-compose.yml @@ -3,7 +3,7 @@ version: "3.8" services: zookeeper: - image: zookeeper + image: zookeeper:3.7 ports: - "2181:2181" volumes: @@ -12,14 +12,14 @@ services: restart: unless-stopped kafka: - image: wurstmeister/kafka + image: wurstmeister/kafka:2.12-2.5.0 ports: - "9092:9092" volumes: - ./data/kafka:/kafka - - /var/run/docker.sock:/var/run/docker.sock environment: - KAFKA_ADVERTISED_HOST_NAME=10.0.0.13 + - KAFKA_ADVERTISED_PORT=9092 - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 - JMX_PORT=9999 depends_on: diff --git a/kafka/cluster/docker-compose-kafka-manager.yml b/kafka/cluster/docker-compose-kafka-manager.yml index 87acada..e78cf95 100644 --- a/kafka/cluster/docker-compose-kafka-manager.yml +++ b/kafka/cluster/docker-compose-kafka-manager.yml @@ -1,17 +1,19 @@ -kafka-manager: - image: vimagick/kafka-manager - ports: - - "9000:9000" - environment: - - ZK_HOSTS=zookeeper1:2181,zookeeper2:2181,zookeeper3:2181 - - KAFKA_MANAGER_AUTH_ENABLED=true - - KAFKA_MANAGER_USERNAME=admin - - KAFKA_MANAGER_PASSWORD=admin - extra_hosts: - - zookeeper1:10.0.0.21 - - zookeeper2:10.0.0.22 - - zookeeper3:10.0.0.23 - - kafka1:10.0.0.21 - - kafka2:10.0.0.22 - - kafka3:10.0.0.23 - restart: always +version: "3.8" +services: + cmak: + image: vimagick/cmak + ports: + - "9000:9000" + environment: + - ZK_HOSTS=zookeeper1:2181,zookeeper2:2181,zookeeper3:2181 + - KAFKA_MANAGER_AUTH_ENABLED=true + - KAFKA_MANAGER_USERNAME=admin + - KAFKA_MANAGER_PASSWORD=admin + extra_hosts: + - zookeeper1:10.0.0.21 + - zookeeper2:10.0.0.22 + - zookeeper3:10.0.0.23 + - kafka1:10.0.0.21 + - kafka2:10.0.0.22 + - kafka3:10.0.0.23 + restart: unless-stopped diff --git a/kafka/cluster/docker-compose-kafka1.yml b/kafka/cluster/docker-compose-kafka1.yml index 26c50cc..c15a343 100644 --- a/kafka/cluster/docker-compose-kafka1.yml +++ b/kafka/cluster/docker-compose-kafka1.yml @@ -1,27 +1,28 @@ -kafka: - image: wurstmeister/kafka:2.12-2.4.0 - ports: - - "9092:9092" - - "9999:9999" - hostname: kafka1 - volumes: - - /data/kafka:/kafka - - /var/run/docker.sock:/var/run/docker.sock - environment: - - KAFKA_BROKER_ID=1 - - KAFKA_LISTENERS=PLAINTEXT://:9092 - - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka1:9092 - - KAFKA_ZOOKEEPER_CONNECT=zookeeper1:2181,zookeeper2:2181,zookeeper3:2181 - - KAFKA_JMX_OPTS=-Dcom.sun.management.jmxremote - -Dcom.sun.management.jmxremote.authenticate=false - -Dcom.sun.management.jmxremote.ssl=false - -Dcom.sun.management.jmxremote.rmi.port=9999 - -Dcom.sun.management.jmxremote.port=9999 - extra_hosts: - - zookeeper1:10.0.0.21 - - zookeeper2:10.0.0.22 - - zookeeper3:10.0.0.23 - - kafka1:10.0.0.21 - - kafka2:10.0.0.22 - - kafka3:10.0.0.23 - restart: always +version: "3.8" +services: + kafka: + image: wurstmeister/kafka:2.12-2.5.0 + ports: + - "9092:9092" + - "9999:9999" + hostname: kafka1 + volumes: + - /data/kafka:/kafka + environment: + - KAFKA_BROKER_ID=1 + - KAFKA_LISTENERS=PLAINTEXT://:9092 + - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka1:9092 + - KAFKA_ZOOKEEPER_CONNECT=zookeeper1:2181,zookeeper2:2181,zookeeper3:2181 + - KAFKA_JMX_OPTS=-Dcom.sun.management.jmxremote + -Dcom.sun.management.jmxremote.authenticate=false + -Dcom.sun.management.jmxremote.ssl=false + -Dcom.sun.management.jmxremote.rmi.port=9999 + -Dcom.sun.management.jmxremote.port=9999 + extra_hosts: + - zookeeper1:10.0.0.21 + - zookeeper2:10.0.0.22 + - zookeeper3:10.0.0.23 + - kafka1:10.0.0.21 + - kafka2:10.0.0.22 + - kafka3:10.0.0.23 + restart: unless-stopped diff --git a/kafka/cluster/docker-compose-zookeeper1.yml b/kafka/cluster/docker-compose-zookeeper1.yml index 991619f..6cf71ef 100644 --- a/kafka/cluster/docker-compose-zookeeper1.yml +++ b/kafka/cluster/docker-compose-zookeeper1.yml @@ -1,22 +1,24 @@ -zookeeper: - image: zookeeper:3.5.6 - ports: - - "2181:2181" - - "2888:2888" - - "3888:3888" - hostname: zookeeper1 - volumes: - - /data/zookeeper/data:/data - - /data/zookeeper/datalog:/datalog - - /data/zookeeper/logs:/logs - environment: - - ZOO_MY_ID=1 - - ZOO_SERVERS=quorumListenOnAllIPs=true server.1=zookeeper1:2888:3888;2181 server.2=zookeeper2:2888:3888;2181 server.3=zookeeper3:2888:3888;2181 - - ZOO_LOG4J_PROP=INFO,ROLLINGFILE - - ZOO_4LW_COMMANDS_WHITELIST=* - - ZOO_STANDALONE_ENABLED=false - extra_hosts: - - zookeeper1:10.0.0.21 - - zookeeper2:10.0.0.22 - - zookeeper3:10.0.0.23 - restart: always +version: "3.8" +services: + zookeeper: + image: zookeeper:3.7 + ports: + - "2181:2181" + - "2888:2888" + - "3888:3888" + hostname: zookeeper1 + volumes: + - /data/zookeeper/data:/data + - /data/zookeeper/datalog:/datalog + - /data/zookeeper/logs:/logs + environment: + - ZOO_MY_ID=1 + - ZOO_SERVERS=quorumListenOnAllIPs=true server.1=zookeeper1:2888:3888;2181 server.2=zookeeper2:2888:3888;2181 server.3=zookeeper3:2888:3888;2181 + - ZOO_LOG4J_PROP=INFO,ROLLINGFILE + - ZOO_4LW_COMMANDS_WHITELIST=* + - ZOO_STANDALONE_ENABLED=false + extra_hosts: + - zookeeper1:10.0.0.21 + - zookeeper2:10.0.0.22 + - zookeeper3:10.0.0.23 + restart: unless-stopped diff --git a/kafka/docker-compose.yml b/kafka/docker-compose.yml index 6ff7999..e1ad1bc 100644 --- a/kafka/docker-compose.yml +++ b/kafka/docker-compose.yml @@ -1,38 +1,42 @@ -zookeeper: - image: zookeeper:3.5.6 - ports: - - "2181:2181" - volumes: - - ./data/zookeeper/data:/data - - ./data/zookeeper/datalog:/datalog - restart: always +version: "3.8" -kafka: - image: wurstmeister/kafka:2.12-2.4.0 - ports: - - "9092:9092" - hostname: kafka - volumes: - - ./data/kafka:/kafka - - /var/run/docker.sock:/var/run/docker.sock - environment: - - KAFKA_ADVERTISED_HOST_NAME=kafka - - KAFKA_ADVERTISED_PORT=9092 - - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 - links: - - zookeeper - restart: always +services: -kafka-manager: - image: vimagick/kafka-manager - ports: - - "9000:9000" - environment: - - ZK_HOSTS=zookeeper:2181 - - KAFKA_MANAGER_AUTH_ENABLED=true - - KAFKA_MANAGER_USERNAME=admin - - KAFKA_MANAGER_PASSWORD=admin - links: - - zookeeper - - kafka - restart: always + zookeeper: + image: zookeeper:3.7 + ports: + - "2181:2181" + volumes: + - ./data/zookeeper/data:/data + - ./data/zookeeper/datalog:/datalog + restart: unless-stopped + + kafka: + image: wurstmeister/kafka:2.12-2.5.0 + ports: + - "9092:9092" + volumes: + - ./data/kafka:/kafka + environment: + - KAFKA_ADVERTISED_HOST_NAME=kafka + - KAFKA_ADVERTISED_PORT=9092 + - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 + - JMX_PORT=9999 + depends_on: + - zookeeper + restart: unless-stopped + + cmak: + image: vimagick/cmak + ports: + - "9000:9000" + environment: + - ZK_HOSTS=zookeeper:2181 + - KAFKA_MANAGER_AUTH_ENABLED=true + - KAFKA_MANAGER_USERNAME=admin + - KAFKA_MANAGER_PASSWORD=admin + depends_on: + - zookeeper + healthcheck: + test: curl -f http://127.0.0.1:9000/api/health || exit 1 + restart: unless-stopped diff --git a/zookeeper/README.md b/zookeeper/README.md index 02371e2..e497aed 100644 --- a/zookeeper/README.md +++ b/zookeeper/README.md @@ -10,18 +10,20 @@ which enables highly reliable distributed coordination. ## docker-compose.yml ```yaml -zookeeper: - image: zookeeper - ports: - - "2181:2181" - volumes: - - ./data/data:/data - - ./data/datalog:/datalog - - ./data/logs:/logs - environment: - - ZOO_LOG4J_PROP=INFO,ROLLINGFILE - - ZOO_STANDALONE_ENABLED=true - restart: always +version: "3.8" +services: + zookeeper: + image: zookeeper + ports: + - "2181:2181" + volumes: + - ./data/data:/data + - ./data/datalog:/datalog + - ./data/logs:/logs + environment: + - ZOO_LOG4J_PROP=INFO,ROLLINGFILE + - ZOO_STANDALONE_ENABLED=true + restart: unless-stopped ``` ## Standalone Mode diff --git a/zookeeper/docker-compose.yml b/zookeeper/docker-compose.yml index 0e3de99..3a47264 100644 --- a/zookeeper/docker-compose.yml +++ b/zookeeper/docker-compose.yml @@ -1,12 +1,14 @@ -zookeeper: - image: zookeeper - ports: - - "2181:2181" - volumes: - - ./data/data:/data - - ./data/datalog:/datalog - - ./data/logs:/logs - environment: - - ZOO_LOG4J_PROP=INFO,ROLLINGFILE - - ZOO_STANDALONE_ENABLED=true - restart: always +version: "3.8" +services: + zookeeper: + image: zookeeper + ports: + - "2181:2181" + volumes: + - ./data/data:/data + - ./data/datalog:/datalog + - ./data/logs:/logs + environment: + - ZOO_LOG4J_PROP=INFO,ROLLINGFILE + - ZOO_STANDALONE_ENABLED=true + restart: unless-stopped