1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-01-02 03:37:40 +02:00

update kafka

This commit is contained in:
kev 2021-11-26 14:58:00 +08:00
parent 4961cd416d
commit 8a0b8f9cf5
7 changed files with 142 additions and 129 deletions

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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