Skip to content

Commit 88b90bc

Browse files
committed
Added explicit hostname so that the container knows who it is
1 parent d9b55dc commit 88b90bc

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

full-stack.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
zoo1:
55
image: zookeeper:3.4.9
66
restart: always
7+
hostname: zoo1
78
ports:
89
- "2181:2181"
910
environment:
@@ -14,6 +15,7 @@ services:
1415

1516
kafka1:
1617
image: confluentinc/cp-kafka:3.1.1
18+
hostname: kafka1
1719
ports:
1820
- "9092:9092"
1921
environment:
@@ -27,6 +29,7 @@ services:
2729

2830
kafka-schema-registry:
2931
image: confluentinc/cp-schema-registry
32+
hostname: kafka-schema-registry
3033
ports:
3134
- "8081:8081"
3235
environment:
@@ -49,6 +52,7 @@ services:
4952

5053
kafka-rest-proxy:
5154
image: confluentinc/cp-kafka-rest:3.1.1
55+
hostmame: kafka-rest-proxy
5256
ports:
5357
- "8082:8082"
5458
environment:
@@ -76,6 +80,7 @@ services:
7680

7781
kafka-connect:
7882
image: confluentinc/cp-kafka-connect:3.1.1
83+
hostname: kafka-connect
7984
ports:
8085
- "8083:8083"
8186
environment:

zk-multiple-kafka-multiple.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
zoo1:
55
image: zookeeper:3.4.9
66
restart: always
7+
hostname: zoo1
78
ports:
89
- "2181:2181"
910
environment:
@@ -12,6 +13,7 @@ services:
1213
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
1314
zoo2:
1415
image: zookeeper:3.4.9
16+
hostname: zoo2
1517
restart: always
1618
ports:
1719
- "2182:2182"
@@ -22,6 +24,7 @@ services:
2224

2325
zoo3:
2426
image: zookeeper:3.4.9
27+
hostname: zoo3
2528
restart: always
2629
ports:
2730
- "2183:2183"
@@ -34,6 +37,7 @@ services:
3437

3538
kafka1:
3639
image: confluentinc/cp-kafka:3.1.1
40+
hostname: kafka1
3741
ports:
3842
- "9092:9092"
3943
environment:
@@ -49,6 +53,7 @@ services:
4953

5054
kafka2:
5155
image: confluentinc/cp-kafka:3.1.1
56+
hostname: kafka2
5257
ports:
5358
- "9093:9093"
5459
environment:

zk-multiple-kafka-single.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
zoo1:
55
image: zookeeper:3.4.9
66
restart: always
7+
hostname: zoo1
78
ports:
89
- "2181:2181"
910
environment:
@@ -12,6 +13,7 @@ services:
1213
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
1314
zoo2:
1415
image: zookeeper:3.4.9
16+
hostname: zoo2
1517
restart: always
1618
ports:
1719
- "2182:2182"
@@ -22,6 +24,7 @@ services:
2224

2325
zoo3:
2426
image: zookeeper:3.4.9
27+
hostname: zoo3
2528
restart: always
2629
ports:
2730
- "2183:2183"
@@ -33,6 +36,7 @@ services:
3336

3437
kafka1:
3538
image: confluentinc/cp-kafka:3.1.1
39+
hostname: kafka1
3640
ports:
3741
- "9092:9092"
3842
environment:

zk-single-kafka-multiple.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
zoo1:
55
image: zookeeper:3.4.9
66
restart: always
7+
hostname: zoo1
78
ports:
89
- "2181:2181"
910
environment:
@@ -14,6 +15,7 @@ services:
1415

1516
kafka1:
1617
image: confluentinc/cp-kafka:3.1.1
18+
hostname: kafka1
1719
ports:
1820
- "9092:9092"
1921
environment:
@@ -27,6 +29,7 @@ services:
2729

2830
kafka2:
2931
image: confluentinc/cp-kafka:3.1.1
32+
hostname: kafka2
3033
ports:
3134
- "9093:9093"
3235
environment:

zk-single-kafka-single.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
zoo1:
55
image: zookeeper:3.4.9
66
restart: always
7+
hostname: zoo1
78
ports:
89
- "2181:2181"
910
environment:
@@ -13,6 +14,7 @@ services:
1314

1415
kafka1:
1516
image: confluentinc/cp-kafka:3.1.1
17+
hostname: kafka1
1618
ports:
1719
- "9092:9092"
1820
environment:

0 commit comments

Comments
 (0)