Update compose file to use redpanda

This commit is contained in:
2023-01-02 16:49:58 +01:00
parent d6d67a2756
commit 456ce3a4ed

View File

@@ -1,93 +1,91 @@
# https://blog.exxeta.com/en/2021/05/20/kafka-cluster-setup-with-docker-and-docker-compose/ # https://github.com/redpanda-data/documentation/blob/131f7de1593072488b81a4a59f89e2111bdc71fd/docs/platform/console/reference/docker-compose.mdx
version: "3" version: '3.7'
networks:
kafka-cluster:
name: kafka-cluster
driver: bridge
services: services:
zookeeper: redpanda:
image: bitnami/zookeeper:3.7.0 image: docker.redpanda.com/vectorized/redpanda:v22.3.8
container_name: zookeeper command:
- redpanda start
- --smp 1
- --overprovisioned
- --node-id 0
- --kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
- --advertise-kafka-addr PLAINTEXT://redpanda:29092,OUTSIDE://localhost:9092
- --pandaproxy-addr 0.0.0.0:8082
- --advertise-pandaproxy-addr localhost:8082
ports: ports:
- '2181:2181' - 8081:8081
environment: - 8082:8082
- ALLOW_ANONYMOUS_LOGIN=yes - 9092:9092
networks: - 9644:9644
- kafka-cluster - 29092:29092
tmpfs:
- "/datalog"
kafka1: console:
image: bitnami/kafka:3.1.0 image: docker.redpanda.com/vectorized/console:v2.1.1
container_name: kafka1 entrypoint: /bin/sh
ports: command: -c "echo \"$$CONSOLE_CONFIG_FILE\" > /tmp/config.yml; /app/console"
- '9093:9093'
environment: environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 CONFIG_FILEPATH: /tmp/config.yml
- ALLOW_PLAINTEXT_LISTENER=yes CONSOLE_CONFIG_FILE: |
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT kafka:
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9093 brokers: ["redpanda:29092"]
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka1:9092,EXTERNAL://localhost:9093 schemaRegistry:
- KAFKA_INTER_BROKER_LISTENER_NAME=CLIENT enabled: true
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true urls: ["http://redpanda:8081"]
depends_on: redpanda:
- zookeeper adminApi:
networks: enabled: true
- kafka-cluster urls: ["http://redpanda:9644"]
connect:
kafka2: enabled: true
image: bitnami/kafka:3.1.0 clusters:
container_name: kafka2 - name: local-connect-cluster
url: http://connect:8083
ports: ports:
- '9094:9094' - 8080:8080
depends_on:
- redpanda
# Owl Shop is an application that simulates an ecommerce shop that uses Kafka.
# It is part of this docker compose so that you have some sample data that you can
# browse with Console.
owl-shop:
image: quay.io/cloudhut/owl-shop:latest
environment: environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 - SHOP_KAFKA_BROKERS=redpanda:29092
- ALLOW_PLAINTEXT_LISTENER=yes - SHOP_KAFKA_TOPICREPLICATIONFACTOR=1
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT - SHOP_TRAFFIC_INTERVAL_RATE=1
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9094 - SHOP_TRAFFIC_INTERVAL_DURATION=0.1s
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka2:9092,EXTERNAL://localhost:9094
- KAFKA_INTER_BROKER_LISTENER_NAME=CLIENT
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true
depends_on: depends_on:
- zookeeper - redpanda
networks:
- kafka-cluster
kafka3: connect:
image: bitnami/kafka:3.1.0 image: docker.redpanda.com/vectorized/connectors:1.0.0-dev-dff1c57
container_name: kafka3 hostname: connect
container_name: connect
depends_on:
- redpanda
ports: ports:
- '9095:9095' - "8083:8083"
environment: environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 CONNECT_CONFIGURATION: |
- ALLOW_PLAINTEXT_LISTENER=yes key.converter=org.apache.kafka.connect.converters.ByteArrayConverter
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT value.converter=org.apache.kafka.connect.converters.ByteArrayConverter
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9095 group.id=connectors-cluster
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka3:9092,EXTERNAL://localhost:9095 offset.storage.topic=_internal_connectors_offsets
- KAFKA_INTER_BROKER_LISTENER_NAME=CLIENT config.storage.topic=_internal_connectors_configs
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true status.storage.topic=_internal_connectors_status
depends_on: config.storage.replication.factor=-1
- zookeeper offset.storage.replication.factor=-1
networks: status.storage.replication.factor=-1
- kafka-cluster offset.flush.interval.ms=1000
producer.linger.ms=50
kowl: producer.batch.size=131072
image: quay.io/cloudhut/kowl:v1.4.0 CONNECT_BOOTSTRAP_SERVERS: redpanda:29092
container_name: kowl CONNECT_GC_LOG_ENABLED: "false"
restart: on-failure CONNECT_HEAP_OPTS: -Xms512M -Xmx512M
hostname: kowl CONNECT_LOG_LEVEL: info
volumes:
- ./config.yaml:/etc/kowl/config.yaml
ports:
- "8080:8080"
entrypoint: ./kowl --config.filepath=/etc/kowl/config.yaml
depends_on:
- kafka1
networks:
- kafka-cluster
kafka-lag-exporter: kafka-lag-exporter:
build: . build: .
@@ -95,11 +93,7 @@ services:
ports: ports:
- '4000:4000' - '4000:4000'
environment: environment:
- KAFKA_BROKERS=kafka1:9092,kafka2:9092,kafka3:9092 - KAFKA_BROKERS=redpanda:29092
depends_on: depends_on:
- kafka1 - redpanda
- kafka2
- kafka3
restart: "unless-stopped" restart: "unless-stopped"
networks:
- kafka-cluster