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,5 +1,7 @@
kafka-manager:
image: vimagick/kafka-manager
version: "3.8"
services:
cmak:
image: vimagick/cmak
ports:
- "9000:9000"
environment:
@ -14,4 +16,4 @@ kafka-manager:
- kafka1:10.0.0.21
- kafka2:10.0.0.22
- kafka3:10.0.0.23
restart: always
restart: unless-stopped

View File

@ -1,12 +1,13 @@
version: "3.8"
services:
kafka:
image: wurstmeister/kafka:2.12-2.4.0
image: wurstmeister/kafka:2.12-2.5.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
@ -24,4 +25,4 @@ kafka:
- kafka1:10.0.0.21
- kafka2:10.0.0.22
- kafka3:10.0.0.23
restart: always
restart: unless-stopped

View File

@ -1,5 +1,7 @@
version: "3.8"
services:
zookeeper:
image: zookeeper:3.5.6
image: zookeeper:3.7
ports:
- "2181:2181"
- "2888:2888"
@ -19,4 +21,4 @@ zookeeper:
- zookeeper1:10.0.0.21
- zookeeper2:10.0.0.22
- zookeeper3:10.0.0.23
restart: always
restart: unless-stopped

View File

@ -1,30 +1,33 @@
version: "3.8"
services:
zookeeper:
image: zookeeper:3.5.6
image: zookeeper:3.7
ports:
- "2181:2181"
volumes:
- ./data/zookeeper/data:/data
- ./data/zookeeper/datalog:/datalog
restart: always
restart: unless-stopped
kafka:
image: wurstmeister/kafka:2.12-2.4.0
image: wurstmeister/kafka:2.12-2.5.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:
- JMX_PORT=9999
depends_on:
- zookeeper
restart: always
restart: unless-stopped
kafka-manager:
image: vimagick/kafka-manager
cmak:
image: vimagick/cmak
ports:
- "9000:9000"
environment:
@ -32,7 +35,8 @@ kafka-manager:
- KAFKA_MANAGER_AUTH_ENABLED=true
- KAFKA_MANAGER_USERNAME=admin
- KAFKA_MANAGER_PASSWORD=admin
links:
depends_on:
- zookeeper
- kafka
restart: always
healthcheck:
test: curl -f http://127.0.0.1:9000/api/health || exit 1
restart: unless-stopped

View File

@ -10,6 +10,8 @@ which enables highly reliable distributed coordination.
## docker-compose.yml
```yaml
version: "3.8"
services:
zookeeper:
image: zookeeper
ports:
@ -21,7 +23,7 @@ zookeeper:
environment:
- ZOO_LOG4J_PROP=INFO,ROLLINGFILE
- ZOO_STANDALONE_ENABLED=true
restart: always
restart: unless-stopped
```
## Standalone Mode

View File

@ -1,3 +1,5 @@
version: "3.8"
services:
zookeeper:
image: zookeeper
ports:
@ -9,4 +11,4 @@ zookeeper:
environment:
- ZOO_LOG4J_PROP=INFO,ROLLINGFILE
- ZOO_STANDALONE_ENABLED=true
restart: always
restart: unless-stopped