You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-50Lines changed: 29 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,9 @@
3
3
4
4
# kafka-stack-docker-compose
5
5
6
-
This replicates as well as possible real deployment configurations, where you have your zookeeper servers and kafka servers actually all distinct from each other. This solves all the networking hurdles that comes with docker-compose, and is compatible cross platform. It only requires an update to your host files.
6
+
This replicates as well as possible real deployment configurations, where you have your zookeeper servers and kafka servers actually all distinct from each other. This solves all the networking hurdles that comes with Docker and docker-compose, and is compatible cross platform.
7
+
8
+
[UPDATE]: No /etc/hosts file changes are necessary anymore. Explanations at: https://rmoff.net/2018/08/02/kafka-listeners-explained/
7
9
8
10
## Stack version
9
11
@@ -19,52 +21,29 @@ This replicates as well as possible real deployment configurations, where you ha
19
21
20
22
# Requirements
21
23
22
-
## Host File changes
23
-
24
-
See https://support.rackspace.com/how-to/modify-your-hosts-file/ to detailed instructions on how to modify your host files.
24
+
## Docker
25
25
26
-
If you are using Docker for Mac >= 1.12, Docker for Linux, or Docker for Windows 10, then please add the following lines to `/etc/hosts` or `C:\Windows\System32\Drivers\etc\hosts`:
26
+
Please export your environment before starting the stack:
27
27
```
28
-
127.0.0.1 kafka1
29
-
127.0.0.1 kafka2
30
-
127.0.0.1 kafka3
31
-
127.0.0.1 zoo1
32
-
127.0.0.1 zoo2
33
-
127.0.0.1 zoo3
34
-
127.0.0.1 kafka-schema-registry
35
-
127.0.0.1 kafka-schema-registry-ui
36
-
127.0.0.1 kafka-rest-proxy
37
-
127.0.0.1 kafka-topics-ui
38
-
127.0.0.1 kafka-connect-ui
39
-
127.0.0.1 zoonavigator-web
40
-
127.0.0.1 zoonavigator-api
28
+
export DOCKER_HOST_IP=127.0.0.1
41
29
```
30
+
(that's the default value and you actually don't need to do a thing)
42
31
32
+
## Docker-Toolbox
43
33
If you are using Docker for Mac <= 1.11, or Docker Toolbox for Windows
44
34
(your docker machine IP is usually `192.168.99.100`)
45
-
Please add the following lines to `/etc/hosts` or `C:\Windows\System32\Drivers\etc\hosts`:
35
+
36
+
Please export your environment before starting the stack:
46
37
```
47
-
192.168.99.100 kafka1
48
-
192.168.99.100 kafka2
49
-
192.168.99.100 kafka3
50
-
192.168.99.100 zoo1
51
-
192.168.99.100 zoo2
52
-
192.168.99.100 zoo3
53
-
192.168.99.100 kafka-schema-registry
54
-
192.168.99.100 kafka-schema-registry-ui
55
-
192.168.99.100 kafka-rest-proxy
56
-
192.168.99.100 kafka-topics-ui
57
-
192.168.99.100 kafka-connect-ui
58
-
192.168.99.100 zoonavigator-web
59
-
192.168.99.100 zoonavigator-api
38
+
export DOCKER_HOST_IP=192.168.99.100
60
39
```
61
40
62
41
## Single Zookeeper / Single Kafka
63
42
64
43
This configuration fits most development requirements.
65
44
66
-
- Zookeeper will be available at `zoo1:2181`
67
-
- Kafka will be available at `kafka1:9092`
45
+
- Zookeeper will be available at `$DOCKER_HOST_IP:2181`
46
+
- Kafka will be available at `$DOCKER_HOST_IP:9092`
68
47
69
48
70
49
Run with:
@@ -77,8 +56,8 @@ docker-compose -f zk-single-kafka-single.yml down
77
56
78
57
If you want to have two brokers and experiment with replication / fault-tolerance.
79
58
80
-
- Zookeeper will be available at `zoo1:2181`
81
-
- Kafka will be available at `kafka1:9092,kafka2:9093,kafka3:9094`
59
+
- Zookeeper will be available at `$DOCKER_HOST_IP:2181`
60
+
- Kafka will be available at `$DOCKER_HOST_IP:9092,$DOCKER_HOST_IP:9093,$DOCKER_HOST_IP:9094`
82
61
83
62
84
63
Run with:
@@ -91,22 +70,22 @@ docker-compose -f zk-single-kafka-multiple.yml down
91
70
92
71
If you want to have three zookeeper and experiment with zookeeper fault-tolerance.
93
72
94
-
- Zookeeper will be available at `zoo1:2181,zoo2:2182,zoo3:2183`
95
-
- Kafka will be available at `kafka1:9092`
73
+
- Zookeeper will be available at `$DOCKER_HOST_IP:2181,$DOCKER_HOST_IP:2182,$DOCKER_HOST_IP:2183`
74
+
- Kafka will be available at `$DOCKER_HOST_IP:9092`
96
75
97
76
Run with:
98
77
```
99
78
docker-compose -f zk-multiple-kafka-single.yml up
100
-
docker-compose -f zk-multiple-kafka-single.yml down
79
+
docker-compose -f ²zk-multiple-kafka-single.yml down
101
80
```
102
81
103
82
104
83
## Multiple Zookeeper / Multiple Kafka
105
84
106
85
If you want to have three zookeeper and two kafka brokers to experiment with production setup.
107
86
108
-
- Zookeeper will be available at `zoo1:2181,zoo2:2182,zoo3:2183`
109
-
- Kafka will be available at `kafka1:9092,kafka2:9093,kafka3:9094`
87
+
- Zookeeper will be available at `$DOCKER_HOST_IP:2181,$DOCKER_HOST_IP:2182,$DOCKER_HOST_IP:2183`
88
+
- Kafka will be available at `$DOCKER_HOST_IP:9092,$DOCKER_HOST_IP:9093,$DOCKER_HOST_IP:9094`
110
89
111
90
Run with:
112
91
```
@@ -117,15 +96,15 @@ docker-compose -f zk-multiple-kafka-multiple.yml down
0 commit comments