Skip to content

Commit 3c12d9c

Browse files
authored
Merge pull request #113 from conduktor/arm64
Update CP to version 7.2.0 (M1 support) and enable docker container to kafka connexion
2 parents 8690a77 + 63d128d commit 3c12d9c

7 files changed

+100
-90
lines changed

README.md

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This project is sponsored by [Conduktor.io](https://www.conduktor.io/), a graphical desktop user interface for Apache Kafka.
66

77
Once you have started your cluster, you can use Conduktor to easily manage it.
8-
Just connect against `localhost:9092` if using Docker, or `192.168.99.100` if using Docker Toolbox
8+
Just connect against `localhost:9092`. If you are on Mac or Windows and want to connect from another container, use `host.docker.internal:29092`
99

1010
# kafka-stack-docker-compose
1111

@@ -15,38 +15,36 @@ This replicates as well as possible real deployment configurations, where you ha
1515

1616
## Stack version
1717

18-
- Zookeeper version: 3.6.3 (Confluent 7.1.1)
19-
- Kafka version: 3.1.0 (Confluent 7.1.1)
20-
- Kafka Schema Registry: Confluent 7.1.1
21-
- Kafka Rest Proxy: Confluent 7.1.1
22-
- Kafka Connect: Confluent 7.1.1
23-
- ksqlDB Server: Confluent 7.1.1
18+
- Zookeeper version: 3.6.3 (Confluent 7.2.0)
19+
- Kafka version: 3.2.0 (Confluent 7.2.0)
20+
- Kafka Schema Registry: Confluent 7.2.0
21+
- Kafka Rest Proxy: Confluent 7.2.0
22+
- Kafka Connect: Confluent 7.2.0
23+
- ksqlDB Server: Confluent 7.2.0
2424
- Zoonavigator: 1.1.1
2525

2626
For a UI tool to access your local Kafka cluster, use the free version of [Conduktor](https://www.conduktor.io/download)
2727

2828
# Requirements
2929

30-
## Docker
31-
32-
Please export your environment before starting the stack:
33-
```
34-
export DOCKER_HOST_IP=127.0.0.1
35-
```
36-
(that's the default value and you actually don't need to do a thing)
30+
Kafka will be exposed on `127.0.0.1` or `DOCKER_HOST_IP` if set in the environment.
31+
(You probably don't need to set it if you're not using Docker-Toolbox)
3732

3833
## Docker-Toolbox
39-
If you are using Docker for Mac <= 1.11, or Docker Toolbox for Windows
40-
(your docker machine IP is usually `192.168.99.100`)
41-
42-
Please export your environment before starting the stack:
34+
Docker toolbox is [deprecated](https://github.com/docker-archive/toolbox) and not maintained anymore for several years.
35+
We can't guarantee this stack will work with Docker Toolbox, but if you want to try anyway, please export your environment before starting the stack:
4336
```
4437
export DOCKER_HOST_IP=192.168.99.100
4538
```
39+
(your docker machine IP is usually `192.168.99.100`)
40+
41+
## Apple M1 support
42+
Confluent platform supports Apple M1 (ARM64) since version `7.2.0`! Basically, this stack will work out of the box.
4643

47-
## Mac M1 issues
44+
If you want to downgrade confluent platform version, there are two ways:
4845

49-
Currently, the Docker Images are not working with M1 Mac. This is because they haven't been built by Confluent for that platform. See [confluentinc/common-docker/#117](https://github.com/confluentinc/common-docker/issues/117) for more details
46+
1. Add `platform: linux/amd64`. It will work as docker is able to emulate AMD64 instructions.
47+
2. Previous versions have been [built](https://github.com/arm64-compat/confluent-platform) for ARM64 by the community. If you want to use it, just change the image in the corresponding yml. Since it is a not an official image, use it at your own risks.
5048

5149
## Single Zookeeper / Single Kafka
5250

@@ -155,12 +153,12 @@ A: yes. Say you want to change `zoo1` port to `12181` (only relevant lines are s
155153
A: yes. Say you want to change `kafka1` port to `12345` (only relevant lines are shown). Note only `LISTENER_DOCKER_EXTERNAL` changes:
156154
```
157155
kafka1:
158-
image: confluentinc/cp-kafka:7.1.1
156+
image: confluentinc/cp-kafka:7.2.0
159157
hostname: kafka1
160158
ports:
161159
- "12345:12345"
162160
environment:
163-
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:12345
161+
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka1:19092,EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:12345,DOCKER://host.docker.internal:29092
164162
```
165163

166164
**Q: Kafka is using a lot of disk space for testing. Can I reduce it?**
@@ -169,7 +167,7 @@ A: yes. This is for testing only!!! Reduce the KAFKA_LOG_SEGMENT_BYTES to 16MB a
169167

170168
```
171169
kafka1:
172-
image: confluentinc/cp-kafka:7.1.1
170+
image: confluentinc/cp-kafka:7.2.0
173171
...
174172
environment:
175173
...
@@ -185,11 +183,11 @@ For example, if the IP of your machine is `50.10.2.3`, follow the sample mapping
185183

186184
```
187185
kafka1:
188-
image: confluentinc/cp-kafka:7.1.1
186+
image: confluentinc/cp-kafka:7.2.0
189187
...
190188
environment:
191189
...
192-
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka2:19093,LISTENER_DOCKER_EXTERNAL://50.10.2.3:9093
190+
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka2:19093,EXTERNAL://50.10.2.3:9093,DOCKER://host.docker.internal:29093
193191
```
194192

195193
**Q: How do I add connectors to kafka connect?**

full-stack.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '2.1'
22

33
services:
44
zoo1:
5-
image: confluentinc/cp-zookeeper:7.1.1
5+
image: confluentinc/cp-zookeeper:7.2.0
66
hostname: zoo1
77
container_name: zoo1
88
ports:
@@ -13,16 +13,17 @@ services:
1313
ZOOKEEPER_SERVERS: zoo1:2888:3888
1414

1515
kafka1:
16-
image: confluentinc/cp-kafka:7.1.1
16+
image: confluentinc/cp-kafka:7.2.0
1717
hostname: kafka1
1818
container_name: kafka1
1919
ports:
2020
- "9092:9092"
21+
- "29092:29092"
2122
- "9999:9999"
2223
environment:
23-
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
24-
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
25-
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
24+
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka1:19092,EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092,DOCKER://host.docker.internal:29092
25+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT
26+
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
2627
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181"
2728
KAFKA_BROKER_ID: 1
2829
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
@@ -37,7 +38,7 @@ services:
3738
- zoo1
3839

3940
kafka-schema-registry:
40-
image: confluentinc/cp-schema-registry:7.1.1
41+
image: confluentinc/cp-schema-registry:7.2.0
4142
hostname: kafka-schema-registry
4243
container_name: kafka-schema-registry
4344
ports:
@@ -52,7 +53,7 @@ services:
5253

5354

5455
kafka-rest-proxy:
55-
image: confluentinc/cp-kafka-rest:7.1.1
56+
image: confluentinc/cp-kafka-rest:7.2.0
5657
hostname: kafka-rest-proxy
5758
container_name: kafka-rest-proxy
5859
ports:
@@ -70,7 +71,7 @@ services:
7071

7172

7273
kafka-connect:
73-
image: confluentinc/cp-kafka-connect:7.1.1
74+
image: confluentinc/cp-kafka-connect:7.2.0
7475
hostname: kafka-connect
7576
container_name: kafka-connect
7677
ports:
@@ -112,7 +113,7 @@ services:
112113
113114
114115
ksqldb-server:
115-
image: confluentinc/cp-ksqldb-server:7.1.1
116+
image: confluentinc/cp-ksqldb-server:7.2.0
116117
hostname: ksqldb-server
117118
container_name: ksqldb-server
118119
ports:

zk-multiple-kafka-multiple-schema-registry.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '2.1'
22

33
services:
44
zoo1:
5-
image: confluentinc/cp-zookeeper:7.1.1
5+
image: confluentinc/cp-zookeeper:7.2.0
66
hostname: zoo1
77
container_name: zoo1
88
ports:
@@ -13,7 +13,7 @@ services:
1313
ZOOKEEPER_SERVERS: zoo1:2888:3888;zoo2:2888:3888;zoo3:2888:3888
1414

1515
zoo2:
16-
image: confluentinc/cp-zookeeper:7.1.1
16+
image: confluentinc/cp-zookeeper:7.2.0
1717
hostname: zoo2
1818
container_name: zoo2
1919
ports:
@@ -24,7 +24,7 @@ services:
2424
ZOOKEEPER_SERVERS: zoo1:2888:3888;zoo2:2888:3888;zoo3:2888:3888
2525

2626
zoo3:
27-
image: confluentinc/cp-zookeeper:7.1.1
27+
image: confluentinc/cp-zookeeper:7.2.0
2828
hostname: zoo3
2929
container_name: zoo3
3030
ports:
@@ -36,15 +36,16 @@ services:
3636

3737

3838
kafka1:
39-
image: confluentinc/cp-kafka:7.1.1
39+
image: confluentinc/cp-kafka:7.2.0
4040
hostname: kafka1
4141
container_name: kafka1
4242
ports:
4343
- "9092:9092"
44+
- "29092:29092"
4445
environment:
45-
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
46-
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
47-
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
46+
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka1:19092,EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092,DOCKER://host.docker.internal:29092
47+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT
48+
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
4849
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
4950
KAFKA_BROKER_ID: 1
5051
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
@@ -56,15 +57,16 @@ services:
5657
- zoo3
5758

5859
kafka2:
59-
image: confluentinc/cp-kafka:7.1.1
60+
image: confluentinc/cp-kafka:7.2.0
6061
hostname: kafka2
6162
container_name: kafka2
6263
ports:
6364
- "9093:9093"
65+
- "29093:29093"
6466
environment:
65-
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka2:19093,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9093
66-
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
67-
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
67+
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka2:19093,EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9093,DOCKER://host.docker.internal:29093
68+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT
69+
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
6870
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
6971
KAFKA_BROKER_ID: 2
7072
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
@@ -76,15 +78,16 @@ services:
7678
- zoo3
7779

7880
kafka3:
79-
image: confluentinc/cp-kafka:7.1.1
81+
image: confluentinc/cp-kafka:7.2.0
8082
hostname: kafka3
8183
container_name: kafka3
8284
ports:
8385
- "9094:9094"
86+
- "29094:29094"
8487
environment:
85-
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka3:19094,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9094
86-
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
87-
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
88+
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka3:19094,EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9094,DOCKER://host.docker.internal:29094
89+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT
90+
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
8891
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
8992
KAFKA_BROKER_ID: 3
9093
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
@@ -96,7 +99,7 @@ services:
9699
- zoo3
97100

98101
kafka-schema-registry:
99-
image: confluentinc/cp-schema-registry:7.1.1
102+
image: confluentinc/cp-schema-registry:7.2.0
100103
hostname: kafka-schema-registry
101104
container_name: kafka-schema-registry
102105
depends_on:

zk-multiple-kafka-multiple.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '2.1'
22

33
services:
44
zoo1:
5-
image: confluentinc/cp-zookeeper:7.1.1
5+
image: confluentinc/cp-zookeeper:7.2.0
66
hostname: zoo1
77
container_name: zoo1
88
ports:
@@ -13,7 +13,7 @@ services:
1313
ZOOKEEPER_SERVERS: zoo1:2888:3888;zoo2:2888:3888;zoo3:2888:3888
1414

1515
zoo2:
16-
image: confluentinc/cp-zookeeper:7.1.1
16+
image: confluentinc/cp-zookeeper:7.2.0
1717
hostname: zoo2
1818
container_name: zoo2
1919
ports:
@@ -24,7 +24,7 @@ services:
2424
ZOOKEEPER_SERVERS: zoo1:2888:3888;zoo2:2888:3888;zoo3:2888:3888
2525

2626
zoo3:
27-
image: confluentinc/cp-zookeeper:7.1.1
27+
image: confluentinc/cp-zookeeper:7.2.0
2828
hostname: zoo3
2929
container_name: zoo3
3030
ports:
@@ -37,15 +37,16 @@ services:
3737

3838

3939
kafka1:
40-
image: confluentinc/cp-kafka:7.1.1
40+
image: confluentinc/cp-kafka:7.2.0
4141
hostname: kafka1
4242
container_name: kafka1
4343
ports:
4444
- "9092:9092"
45+
- "29092:29092"
4546
environment:
46-
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
47-
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
48-
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
47+
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka1:19092,EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092,DOCKER://host.docker.internal:29092
48+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT
49+
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
4950
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
5051
KAFKA_BROKER_ID: 1
5152
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
@@ -57,15 +58,16 @@ services:
5758
- zoo3
5859

5960
kafka2:
60-
image: confluentinc/cp-kafka:7.1.1
61+
image: confluentinc/cp-kafka:7.2.0
6162
hostname: kafka2
6263
container_name: kafka2
6364
ports:
6465
- "9093:9093"
66+
- "29093:29093"
6567
environment:
66-
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka2:19093,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9093
67-
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
68-
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
68+
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka2:19093,EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9093,DOCKER://host.docker.internal:29093
69+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT
70+
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
6971
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
7072
KAFKA_BROKER_ID: 2
7173
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
@@ -77,15 +79,16 @@ services:
7779
- zoo3
7880

7981
kafka3:
80-
image: confluentinc/cp-kafka:7.1.1
82+
image: confluentinc/cp-kafka:7.2.0
8183
hostname: kafka3
8284
container_name: kafka3
8385
ports:
8486
- "9094:9094"
87+
- "29094:29094"
8588
environment:
86-
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka3:19094,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9094
87-
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
88-
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
89+
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka3:19094,EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9094,DOCKER://host.docker.internal:29094
90+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT
91+
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
8992
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
9093
KAFKA_BROKER_ID: 3
9194
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"

0 commit comments

Comments
 (0)