Skip to content

Commit 0540edf

Browse files
author
Séamus Ó Ceanainn
authored
Fix Docker compose files and instructions (#93)
1 parent ac1d34f commit 0540edf

File tree

6 files changed

+62
-77
lines changed

6 files changed

+62
-77
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ For further examples see the [docker-compose.yml](basic-example/docker-compose.y
6262
docker-compose -f basic-example/docker-compose.yml up
6363
```
6464

65-
Run remora in IDE with kafka and zookeeper run by docker-compose
65+
Run remora in IDE with kafka and zookeeper run by docker-compose. Note you must set `-e KAFKA_ENDPOINT="kafka:9094"` and `--network basic-example_default` for Remora to work with Kafka from docker-compose.
6666

6767
```bash
6868
docker-compose -f basic-example/docker-compose.yml up --scale remora=0
@@ -71,7 +71,7 @@ docker-compose -f basic-example/docker-compose.yml up --scale remora=0
7171
Remora is stateless, so test the scale of the API
7272

7373
```bash
74-
docker-compose -f scale-example/docker-compose.yml up --scale remora=3
74+
docker-compose -f basic-example/docker-compose.yml up --scale remora=3
7575
```
7676

7777
For examples with broker authentication see the [docker-compose.yml](auth-example/docker-compose.yml)

auth-example/auth.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
security.protocol=SASL_PLAINTEXT
22
sasl.mechanism=PLAIN
3-
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="my-user" password="my-password";
3+
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="kafka" password="kafka-secret";

auth-example/docker-compose.yml

+32-18
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,51 @@
1-
version: '3'
2-
1+
version: '3.2'
32
services:
43

54
zookeeper:
6-
image: 'bitnami/zookeeper:latest'
7-
environment:
8-
- ALLOW_ANONYMOUS_LOGIN=yes
5+
image: wurstmeister/zookeeper
96
ports:
10-
- '2181:2181'
7+
- "2181:2181"
8+
environment:
9+
ALLOW_ANONYMOUS_LOGIN: 'yes'
10+
ZOOKEEPER_SASL_ENABLED: 'false'
1111

1212
kafka:
13-
image: 'bitnami/kafka:latest'
13+
image: wurstmeister/kafka
14+
hostname: kafka
1415
depends_on:
1516
- zookeeper
16-
environment:
17-
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
18-
- ALLOW_PLAINTEXT_LISTENER=yes
19-
- KAFKA_LISTENERS=SASL_PLAINTEXT://:9092
20-
- KAFKA_ADVERTISED_LISTENERS=SASL_PLAINTEXT://localhost:9092
21-
- KAFKA_BROKER_USER=my-user
22-
- KAFKA_BROKER_PASSWORD=my-password
2317
ports:
24-
- '9092:9092'
18+
- "9092:9092"
19+
volumes:
20+
- ./server_jaas.conf:/etc/kafka/server_jaas.conf
21+
environment:
22+
ALLOW_PLAINTEXT_LISTENER: 'yes'
23+
KAFKA_LISTENERS: INTERNAL://0.0.0.0:9094,EXTERNAL://0.0.0.0:9092
24+
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9094,EXTERNAL://localhost:9092
25+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:SASL_PLAINTEXT,EXTERNAL:SASL_PLAINTEXT
26+
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
27+
KAFKA_SASL_ENABLED_MECHANISMS: PLAIN
28+
KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: PLAIN
29+
KAFKA_CREATE_TOPICS: "test-0:1:1,test-1:1:1"
30+
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
31+
KAFKA_BROKER_USER: kafka
32+
KAFKA_BROKER_PASSWORD: kafka-secret
33+
KAFKA_OPTS: "-Djava.security.auth.login.config=/etc/kafka/server_jaas.conf"
34+
ZOOKEEPER_SASL_ENABLED: 'false'
35+
2536

2637
remora:
27-
image: registry.opensource.zalan.do/machina/remora:1.3.0
38+
# Built locally
39+
image: remora:0.1.0-SNAPSHOT
40+
# From Docker
41+
#image: registry.opensource.zalan.do/buffalo/remora:2.0.0
2842
depends_on:
2943
- kafka
30-
hostname: remora
3144
volumes:
3245
- ./auth.properties:/auth.properties
3346
environment:
34-
KAFKA_ENDPOINT: "kafka:9092"
47+
KAFKA_ENDPOINT: "kafka:9094"
3548
KAFKA_COMMAND_CONFIG: "/auth.properties"
49+
VIRTUAL_HOST: 'localhost'
3650
ports:
3751
- "9000:9000"

auth-example/server_jaas.conf

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
KafkaServer {
2+
org.apache.kafka.common.security.plain.PlainLoginModule required
3+
username="kafka"
4+
password="kafka-secret"
5+
user_kafka="kafka-secret";
6+
};
7+
Client{};

basic-example/docker-compose.yml

+20-20
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,36 @@ services:
77
- "2181:2181"
88

99
kafka:
10-
image: wurstmeister/kafka:2.11-2.0.0
10+
image: wurstmeister/kafka:2.13-2.8.1
1111
hostname: kafka
12+
depends_on:
13+
- zookeeper
1214
ports:
13-
- target: 9092
14-
published: 9092
15-
protocol: tcp
16-
mode: host
15+
- "9092:9092"
1716
environment:
18-
KAFKA_LISTENERS: PLAINTEXT://:9092
19-
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
17+
KAFKA_LISTENERS: INTERNAL://0.0.0.0:9094,EXTERNAL://0.0.0.0:9092
18+
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9094,EXTERNAL://localhost:9092
19+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
20+
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
2021
KAFKA_CREATE_TOPICS: "test-0:1:1,test-1:1:1"
2122
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
2223

24+
nginx:
25+
image: jwilder/nginx-proxy
26+
volumes:
27+
- "/var/run/docker.sock:/tmp/docker.sock:ro"
28+
ports:
29+
- "9000:80"
30+
2331
remora:
2432
# Built locally
2533
image: remora:0.1.0-SNAPSHOT
2634
# From repo
27-
#image: registry.opensource.zalan.do/machina/remora:1.3.0
35+
#image: registry.opensource.zalan.do/buffalo/remora:2.0.0
2836
depends_on:
2937
- kafka
3038
environment:
31-
KAFKA_ENDPOINT: "kafka:9092"
32-
# JAVA_OPTS:
33-
# -Xmx1g
34-
# -Dcom.sun.management.jmxremote.rmi.port=9090
35-
# -Dcom.sun.management.jmxremote=true
36-
# -Dcom.sun.management.jmxremote.port=9090
37-
# -Dcom.sun.management.jmxremote.ssl=false
38-
# -Dcom.sun.management.jmxremote.authenticate=false
39-
# -Dcom.sun.management.jmxremote.local.only=false
40-
# -Djava.rmi.server.hostname=localhost
41-
ports:
42-
- 9000:9000
39+
KAFKA_ENDPOINT: "kafka:9094"
40+
VIRTUAL_HOST: 'localhost'
41+
expose:
42+
- 9000

scale-example/docker-compose.yml

-36
This file was deleted.

0 commit comments

Comments
 (0)