-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-kafka-stack.txt
More file actions
42 lines (41 loc) · 1.28 KB
/
docker-compose-kafka-stack.txt
File metadata and controls
42 lines (41 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
version: '3.2'
services:
kafka:
image: wurstmeister/kafka:latest
deploy:
placement:
constraints: [node.role != manager]
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
depends_on:
- zookeeper1
- zookeeper2
- zookeeper3
ports:
- target: 9094
published: 9094
protocol: tcp
mode: host
environment:
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
RACK_COMMAND: '1'
HOSTNAME_COMMAND: "docker info | grep ^Name: | cut -d' ' -f 2"
KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181,zookeeper2:2182,zookeeper3:2183
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_ADVERTISED_PROTOCOL_NAME: OUTSIDE
KAFKA_ADVERTISED_PORT: 9094
KAFKA_PROTOCOL_NAME: INSIDE
KAFKA_PORT: 9092
volumes:
- /var/run/docker.sock:/var/run/docker.sock
#we need to set the network name to [stackname + network]
networks:
- zookeeper_ZookeeperNetwork
#here it's to link the net work of the first stack (zookeeper stack)
networks:
zookeeper_ZookeeperNetwork:
external: true
kafkaNetwork:
#ne reste plus qu'a prendre example-springboot-kafka-master et faire une écriture lecture et trouver un moyen de scale kafka facilement