|
@@ -20,13 +20,27 @@ services:
|
|
environment:
|
|
environment:
|
|
KAFKA_BROKER_ID: 1
|
|
KAFKA_BROKER_ID: 1
|
|
KAFKA_ZOOKEEPER_CONNECT: zookeeper0:2181
|
|
KAFKA_ZOOKEEPER_CONNECT: zookeeper0:2181
|
|
- KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:29091,PLAINTEXT_HOST://localhost:9091
|
|
|
|
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
|
|
|
|
|
|
+ KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:29091,PLAINTEXT_HOST://localhost:9091,PLAIN://kafka0:29090
|
|
|
|
+ KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,PLAIN:PLAINTEXT
|
|
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
|
|
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
|
|
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
|
|
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
|
|
JMX_PORT: 9997
|
|
JMX_PORT: 9997
|
|
KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.rmi.port=9997
|
|
KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.rmi.port=9997
|
|
|
|
|
|
|
|
+ kafka-init-topics0:
|
|
|
|
+ image: confluentinc/cp-kafka:5.1.0
|
|
|
|
+ depends_on:
|
|
|
|
+ - kafka0
|
|
|
|
+ command: "bash -c 'echo Waiting for Kafka to be ready... && \
|
|
|
|
+ cub kafka-ready -b kafka0:29090 1 20 && \
|
|
|
|
+ kafka-topics --create --topic users --partitions 1 --replication-factor 1 --if-not-exists --zookeeper zookeeper0:2181 && \
|
|
|
|
+ kafka-topics --create --topic messages --partitions 1 --replication-factor 1 --if-not-exists --zookeeper zookeeper0:2181'"
|
|
|
|
+ environment:
|
|
|
|
+ KAFKA_BROKER_ID: ignored
|
|
|
|
+ KAFKA_ZOOKEEPER_CONNECT: ignored
|
|
|
|
+ networks:
|
|
|
|
+ - default
|
|
|
|
+
|
|
zookeeper1:
|
|
zookeeper1:
|
|
image: confluentinc/cp-zookeeper:5.1.0
|
|
image: confluentinc/cp-zookeeper:5.1.0
|
|
environment:
|
|
environment:
|
|
@@ -45,9 +59,23 @@ services:
|
|
environment:
|
|
environment:
|
|
KAFKA_BROKER_ID: 1
|
|
KAFKA_BROKER_ID: 1
|
|
KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181
|
|
KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181
|
|
- KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:9092
|
|
|
|
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
|
|
|
|
|
|
+ KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:9092,PLAIN://kafka1:29090
|
|
|
|
+ KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,PLAIN:PLAINTEXT
|
|
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
|
|
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
|
|
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
|
|
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
|
|
JMX_PORT: 9998
|
|
JMX_PORT: 9998
|
|
KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.rmi.port=9998
|
|
KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.rmi.port=9998
|
|
|
|
+
|
|
|
|
+ kafka-init-topics1:
|
|
|
|
+ image: confluentinc/cp-kafka:5.1.0
|
|
|
|
+ depends_on:
|
|
|
|
+ - kafka1
|
|
|
|
+ command: "bash -c 'echo Waiting for Kafka to be ready... && \
|
|
|
|
+ cub kafka-ready -b kafka1:29090 1 20 && \
|
|
|
|
+ kafka-topics --create --topic users --partitions 1 --replication-factor 1 --if-not-exists --zookeeper zookeeper1:2181 && \
|
|
|
|
+ kafka-topics --create --topic messages --partitions 1 --replication-factor 1 --if-not-exists --zookeeper zookeeper1:2181'"
|
|
|
|
+ environment:
|
|
|
|
+ KAFKA_BROKER_ID: ignored
|
|
|
|
+ KAFKA_ZOOKEEPER_CONNECT: ignored
|
|
|
|
+ networks:
|
|
|
|
+ - default
|