For 'Kafka developers' with Kafka, Schema Registry, Connect, Lenses.io StreamReactor Connectors
1M+
Join the Slack Lenses.io Community!
Fast Data Dev is an Apache Kafka development environment packaged as a Docker container. It provides a Kafka ecosystem including a Kafka Broker, Confluent Schema Registry, and Kafka Connect with Lenses.io's Stream Reactor open source connectors (with optional enterprise support) pre-installed. On top of that there are data generators available, a web interface so you can access the various services logs and optionally TLS keystores and truststores, and a ton of settings so you can tailor it to your needs.
Our recommendation is to combine fast-data-dev with Lenses CE (community edition) using our docker-compose, available here. Lenses provides industry-leading Developer Experience for Apache Kafka and Kafka Connect and among many features, you may particularly enjoy our SQL Studio that allows you to run SQL queries on your Kafka topics and the SQL Processors for creating Streaming SQL queries.
Our docker-compose will setup fast-data-dev and Lenses for you.
Start a complete Kafka environment with one command:
docker run --rm \
-p 9092:9092 \
-p 8081:8081 \
-p 8083:8083 \
-p 3030:3030 \
lensesio/fast-data-dev
Access the web interface at: http://localhost:3030 The Kafka Broker will be accessible at localhost:9092, the Schema Registry at http://localhost:8081, and Kafka Connect at http://localhost:8083.
docker run --rm \
-e ADV_HOST=<YOUR_IP_ADDRESS or DNS name> \
-p 9092:9092 \
-p 8081:8081 \
-p 8083:8083 \
-p 3030:3030 \
lensesio/fast-data-dev
This setup may require to allow connections to fast-data-dev from itself. For example if you are running in a Cloud VM, you may need to setup the firewall to not only accept connections from your computer, but also from the VM itself.
This setup allows for both access from your host and the rest of the
docker-compose services. The Broker address from your host is localhost:9092,
whilst for docker-compose services it is kafka:19092.
kafka:
image: lensesio/fast-data-dev:3.9.0
hostname: kafka
environment:
ADV_HOST: kafka
RUNNING_SAMPLEDATA: 1
RUNTESTS: 0
# The next three variables are required if you want to have Kafka
# available at the host for local development. They are tailored to KRaft
# fast-data-dev (3.9.x or later). The broker will be available at localhost:9092.
KAFKA_LISTENERS: PLAINTEXT://:9092,DOCKERCOMPOSE://:19092,CONTROLLER://:16062
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,DOCKERCOMPOSE://demo-kafka:19092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: >
DOCKERCOMPOSE:PLAINTEXT,CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,
SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL
# Makes things a little lighter
DISABLE: debezium-mongodb,debezium-mysql,debezium-postgres,debezium-sqlserver,debezium-jdbc
# These are the ports for Kafka and Schema Registry. You can disable them if
# you don't need to access Kafka from your host.
ports:
- 9092:9092
- 8081:8081
- 8083:8083
- 3030:3030
# Optional, to allow to resume work (persistence)
# volumes:
# - kafka-data-volume:/data
# Enable SSL with automatic certificate generation
docker run --rm -p 9092:9092 -p 8081:8081 -p 3030:3030 -p 8083:8083 \
-e ENABLE_SSL=1 \
-e SSL_EXTRA_HOSTS=myhost.example.com,192.168.1.100 \
lensesio/fast-data-dev
# Access certificates at http://localhost:3030/certs/
# Password for keystores: fastdata
docker run --rm -p 9092:9092 -p 8081:8081 -p 3030:3030 \
-e SAMPLEDATA=0 \
-e RUNTESTS=0 \
-e CONNECT_PORT=0 \
lensesio/fast-data-dev
# Enable specific connectors only
docker run --rm --net=host \
-e CONNECTORS=file \
-e CONNECT_HEAP=2G \
-v /path/to/custom/connector.jar:/connectors/connector.jar \
lensesio/fast-data-dev
Fast Data Dev was first introduced in 2016, back when Kafka was getting traction but was not yet mainstream. We wanted to make it easy for everyone to get streaming within a couple minutes. People starting with Kafka and even experienced engineers hugged our effort and we keep maintaining it since then with upgrades and new features.
We do use vanilla Apache Kafka built from source, and Confluent's Schema Registry also built from source.
The most reliable way to see the current components versions is to check /build.info:
docker run --rm lensesio/fast-data-dev:latest cat /build.info
Enabled by default services:
PLAINTEXT://localhost:9092localhost:9581-e ENABLE_TLS=1-e ADV_HOST=[HOST]. If TLS is enabled,
ADV_HOST will be added to the self-signed certificates. You can also add
extra hosts with -e EXTRA_HOSTS=[HOST1],[HOST2],.../var/run/broker/server.propertiessupervisorctl restart brokerhttp://localhost:8081/var/run/schema-registrysupervisorctl restart schema-registryhttp://localhost:8083localhost:9584docker run --rm lensesio/fast-data-dev:latest \
find /opt/lensesio/connectors -name "kafka-connect-*" -type d -exec basename '{}' \;
-e DISABLE=aws-s3,debezium-jdbc-e CONNECTORS=aws-s3,file/connectors-e CONNECT_PORT=0/var/run/connect/connect-avro-distributed.propertiessupervisorctl restart connect-distributed-e WEB_PORT=0-e USER=[USER] -e PASSWORD=[PASSWORD]-e RUNNING_SAMPLEDATA=1-e SAMPLEDATA=0-e FORWARDLOGS=0-e RUNTESTS=0Disabled by default services:
-e WEB_TERMINAL_PORT=[PORT]-e WEB_TERMINAL_CREDS=[USER]:[PASS]-e SUPERVISORWEB=1-e CONNECT_HEAP_OPTS="-Xmx640M -Xms128M"
-e BROKER_HEAP_OPTS="-Xmx320M -Xms320M"
-e CONNECT_HEAP_OPTS="-Xmx256M -Xms128M"
-e USER=admin # Basic auth username for Web UI (default: kafka)
-e PASSWORD=secret # Basic auth password for Web UI
-e ENABLE_SSL=1 # Enable SSL/TLS for Broker
-e SSL_EXTRA_HOSTS=host1,host2 # Additional SSL certificate hosts
-e WEB_TERMINAL_CREDS=admin:admin
-e SAMPLEDATA=0 # Disable sample data generation
-e RUNNING_SAMPLEDATA=1 # Enable continuous sample data flow
-e RUNTESTS=0 # Disable integration tests
-e FORWARDLOGS=0 # Disable log forwarding to Kafka topics
-e CONNECTORS=jdbc,elastic,hbase # Enable specific connectors only
-e DISABLE=hbase,mongodb # Disable specific connectors
-e DEBUG=1 # Enable debug logging
-e RUN_AS_ROOT=1 # Run services as root user
-e BROWSECONFIGS=1 # Expose service configs in web UI
-e SUPERVISORWEB=1 # Enable supervisor web interface (port 9001)
-e WEB_TERMINAL_PORT=9002 # Enable web terminal
Configure any Kafka component by converting properties to environment variables:
Examples:
# Broker: log.retention.bytes -> KAFKA_LOG_RETENTION_BYTES
-e KAFKA_LOG_RETENTION_BYTES=1073741824
# Schema Registry: kafkastore.topic -> SCHEMA_REGISTRY_KAFKASTORE_TOPIC
-e SCHEMA_REGISTRY_KAFKASTORE_TOPIC=_schemas
# Connect: plugin.path -> CONNECT_PLUGIN_PATH
-e CONNECT_PLUGIN_PATH=/custom/connectors
Execute custom scripts during startup:
# Inline script
-e PRE_SETUP="echo 'Pre-setup script'"
# Script file
-e PRE_SETUP_FILE="/path/to/script.sh"
-v /local/script.sh:/path/to/script.sh
# Remote script
-e PRE_SETUP_URL="https://example.com/setup.sh"
Access Kafka command line tools:
# Run commands directly
docker run --rm -it --net=host lensesio/fast-data-dev \
kafka-topics --bootstrap-server localhost:9092 --list
# Enter container for interactive use
docker run --rm -it --net=host lensesio/fast-data-dev bash
Container fails to start with hostname errors
/etc/hosts: 127.0.0.1 YourHostname localhostServices not accessible from other machines
-e ADV_HOST=<YOUR_IP> and ensure firewall allows connectionsOut of memory errors
-e CONNECT_HEAP=2G -e BROKER_HEAP_OPTS="-Xmx1G"SSL connection issues
fastdata for all keystores# Basic build
docker build -t local/fast-data-dev .
# Multi-architecture build
docker buildx build --platform linux/amd64,linux/arm64 -t local/fast-data-dev .
Content type
Image
Digest
sha256:2ab0403a7…
Size
897.3 MB
Last updated
3 months ago
docker pull landoop/fast-data-dev