|
1 | | -# kafka-stack-docker |
2 | | -docker compose files to create a fully working kafka stack |
| 1 | +# kafka-stack-docker-compose |
| 2 | + |
| 3 | +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. |
| 4 | + |
| 5 | +## Stack version |
| 6 | + |
| 7 | + - Zookeeper version: 3.4.9 |
| 8 | + - Kafka version: 0.10.1.0 |
| 9 | + |
| 10 | +## Single Zookeeper / Single Kafka |
| 11 | + |
| 12 | +This configuration fits most development requirements. |
| 13 | + |
| 14 | + - Zookeeper will be available at `localhost:2181` |
| 15 | + - Kafka will be available at `localhost:9092` |
| 16 | + |
| 17 | +Make sure to add to your `/etc/hosts` file |
| 18 | +``` |
| 19 | +127.0.0.1 kafka1 |
| 20 | +``` |
| 21 | + |
| 22 | +Run with: |
| 23 | +``` |
| 24 | +docker-compose -f zk-single-kafka-single.yml up |
| 25 | +docker-compose -f zk-single-kafka-single.yml down |
| 26 | +``` |
| 27 | + |
| 28 | +## Single Zookeeper / Multiple Kafka |
| 29 | + |
| 30 | +If you want to have two brokers and experiment with replication / fault-tolerance. |
| 31 | + |
| 32 | +- Zookeeper will be available at `localhost:2181` |
| 33 | +- Kafka will be available at `localhost:9092,localhost:9093` |
| 34 | + |
| 35 | +Make sure to add to your `/etc/hosts` file |
| 36 | +``` |
| 37 | +127.0.0.1 kafka1 |
| 38 | +127.0.0.1 kafka2 |
| 39 | +``` |
| 40 | + |
| 41 | +Run with: |
| 42 | +``` |
| 43 | +docker-compose -f zk-single-kafka-multiple.yml up |
| 44 | +docker-compose -f zk-single-kafka-multiple.yml down |
| 45 | +``` |
| 46 | + |
| 47 | +## Multiple Zookeeper / Single Kafka |
| 48 | + |
| 49 | +If you want to have three zookeeper and experiment with zookeeper fault-tolerance. |
| 50 | + |
| 51 | +- Zookeeper will be available at `localhost:2181,localhost:2182,localhost:2183` |
| 52 | +- Kafka will be available at `localhost:9092` |
| 53 | + |
| 54 | +Make sure to add to your `/etc/hosts` file |
| 55 | +``` |
| 56 | +127.0.0.1 kafka1 |
| 57 | +``` |
| 58 | + |
| 59 | +Run with: |
| 60 | +``` |
| 61 | +docker-compose -f zk-multiple-kafka-single.yml up |
| 62 | +docker-compose -f zk-multiple-kafka-single.yml down |
| 63 | +``` |
| 64 | + |
| 65 | + |
| 66 | +## Multiple Zookeeper / Multiple Kafka |
| 67 | + |
| 68 | +If you want to have three zookeeper and two kafka brokers to experiment with production setup. |
| 69 | + |
| 70 | +- Zookeeper will be available at `localhost:2181,localhost:2182,localhost:2183` |
| 71 | +- Kafka will be available at `localhost:9092,localhost:9093` |
| 72 | + |
| 73 | +Make sure to add to your `/etc/hosts` file |
| 74 | +``` |
| 75 | +127.0.0.1 kafka1 |
| 76 | +127.0.0.1 kafka2 |
| 77 | +``` |
| 78 | + |
| 79 | +Run with: |
| 80 | +``` |
| 81 | +docker-compose -f zk-multiple-kafka-multiple.yml up |
| 82 | +docker-compose -f zk-multiple-kafka-multiple.yml down |
| 83 | +``` |
| 84 | + |
| 85 | + |
| 86 | +## Full stack |
| 87 | + |
| 88 | + - Single Zookeeper: `localhost:2181` |
| 89 | + - Single Kafka: `localhost:9092` |
| 90 | + - Kafka Schema Registry: `localhost:8081` |
| 91 | + - Kafka Rest Proxy: `localhost:8082` |
| 92 | + - Kafka Topics UI: `localhost:8000` |
| 93 | + |
| 94 | + |
| 95 | + Make sure to add to your `/etc/hosts` file |
| 96 | + ``` |
| 97 | + 127.0.0.1 kafka1 |
| 98 | + ``` |
| 99 | + |
| 100 | + Run with: |
| 101 | + ``` |
| 102 | + docker-compose -f full-stack.yml up |
| 103 | + docker-compose -f full-stack.yml down |
| 104 | + ``` |
0 commit comments