- zookeeper-data:/var/lib/zookeeper/data
- zookeeper-log:/var/lib/zookeeper/log
- kafka-1:
- image: confluentinc/cp-kafka:7.5.1
- environment:
- KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
- KAFKA_LISTENERS: BROKER://:9092, LOCALHOST://:9081
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, LOCALHOST:PLAINTEXT
- KAFKA_ADVERTISED_LISTENERS: BROKER://kafka-1:9092, LOCALHOST://localhost:9081
- KAFKA_BROKER_ID: 1
- KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
- KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
- volumes:
- - kafka-1-data:/var/lib/kafka/data
- ports:
- - 9081:9081
- stop_grace_period: 120s
- depends_on:
- - zookeeper
-
- kafka-2:
+ kafka:
image: confluentinc/cp-kafka:7.5.1
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: BROKER://:9092, LOCALHOST://:9082
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, LOCALHOST:PLAINTEXT
- KAFKA_ADVERTISED_LISTENERS: BROKER://kafka-2:9092, LOCALHOST://localhost:9082
- KAFKA_BROKER_ID: 2
+ KAFKA_ADVERTISED_LISTENERS: BROKER://kafka:9092, LOCALHOST://localhost:9082
+ KAFKA_BROKER_ID: 1
KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
+ KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+ KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
+ KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
+ KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
volumes:
- - kafka-2-data:/var/lib/kafka/data
+ - kafka-data:/var/lib/kafka/data
ports:
- 9092:9082
- 9082:9082
- networks:
- default:
- aliases:
- - kafka
- stop_grace_period: 120s
- depends_on:
- - zookeeper
-
- kafka-3:
- image: confluentinc/cp-kafka:7.5.1
- environment:
- KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
- KAFKA_LISTENERS: BROKER://:9092, LOCALHOST://:9083
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BROKER:PLAINTEXT, LOCALHOST:PLAINTEXT
- KAFKA_ADVERTISED_LISTENERS: BROKER://kafka-3:9092, LOCALHOST://localhost:9083
- KAFKA_BROKER_ID: 3
- KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
- KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
- volumes:
- - kafka-3-data:/var/lib/kafka/data
- ports:
- - 9083:9083
stop_grace_period: 120s
depends_on:
- zookeeper
schema-registry:
image: confluentinc/cp-schema-registry:7.5.1
environment:
- SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka-1:9092,kafka-2:9092,kafka-3:9092
+ SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka:9092
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8085
SCHEMA_REGISTRY_LOG4J_ROOT_LOGLEVEL: INFO
ports:
- 8085:8085
depends_on:
- - kafka-1
- - kafka-2
- - kafka-3
+ - kafka
connect:
image: confluentinc/cp-kafka-connect:7.5.1
environment:
- CONNECT_BOOTSTRAP_SERVERS: kafka-1:9092,kafka-2:9092,kafka-3:9092
+ CONNECT_BOOTSTRAP_SERVERS: kafka:9092
CONNECT_REST_PORT: 8083
CONNECT_REST_LISTENERS: http://0.0.0.0:8083
CONNECT_REST_ADVERTISED_HOST_NAME: connect
command: sleep infinity
stop_grace_period: 0s
depends_on:
- - kafka-1
- - kafka-2
- - kafka-3
+ - kafka
setup:
image: juplo/toolbox
- bash
- -c
- |
- cub kafka-ready -b kafka-1:9092,kafka-2:9092,kafka-3:9092 3 60 > /dev/null 2>&1 || exit 1
+ cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1
if [ -e INITIALIZED ]
then
echo -n Bereits konfiguriert:
--create \
--topic test \
--partitions 2 \
- --replication-factor 3 \
- --config min.insync.replicas=2 \
+ --replication-factor 1 \
+ --config min.insync.replicas=1 \
&& echo Das Topic \'test\' wurde erfolgreich angelegt: \
&& kafka-topics --bootstrap-server kafka:9092 --describe --topic test \
&& date > INITIALIZED
- name: "connect"
url: "http://connect:8083"
depends_on:
- - kafka-1
- - kafka-2
- - kafka-3
+ - kafka
minio:
image: minio/minio:latest
volumes:
zookeeper-data:
zookeeper-log:
- kafka-1-data:
- kafka-2-data:
- kafka-3-data:
+ kafka-data:
minio: