docker run -d --rm -p 8080:80 digitsy/kafka-magic
In your browser navigate to http://localhost:8080
You can combine configuration parameters in a single docker-compose.yml
file.
version: '3'
services:
magic:
image: "digitsy/kafka-magic"
ports:
- "8080:80"
volumes:
- .:/config
environment:
KMAGIC_ALLOW_TOPIC_DELETE: "true"
KMAGIC_ALLOW_SCHEMA_DELETE: "true"
KMAGIC_CONFIG_STORE_TYPE: "file"
KMAGIC_CONFIG_STORE_CONNECTION: "Data Source=/config/KafkaMagicConfig.db;"
KMAGIC_CONFIG_ENCRYPTION_KEY: "ENTER_YOUR_KEY_HERE"
Run docker-compose up
in the folder where the docker-compose.yml file is located and in your browser navigate to http://localhost:8080 to see the Kafka Magic UI.
To start playing with Kafka Magic you’ll need a test instance of a Kafka cluster. You can quickly create a cluster in several Docker containers, and use another container to run Kafka Magic app.
Here is the docker-compose.yml
file creating and networking Kafka cluster with schema registry and Kafka Magic instance:
---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.3.0
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-server:7.3.0
hostname: kafka
container_name: kafka
depends_on:
- zookeeper
ports:
- "9092:9092"
- "9101:9101"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://kafka:9092
KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CONFLUENT_BALANCER_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_CONFLUENT_SCHEMA_REGISTRY_URL: http://schema-registry:8081
CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: kafka:29092
CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1
CONFLUENT_METRICS_ENABLE: 'true'
CONFLUENT_SUPPORT_CUSTOMER_ID: 'anonymous'
schema:
image: confluentinc/cp-schema-registry:7.3.0
hostname: schema
container_name: schema-registry
depends_on:
- kafka
ports:
- "8081:8081"
environment:
SCHEMA_REGISTRY_HOST_NAME: schema
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'kafka:29092'
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
magic:
image: digitsy/kafka-magic
ports:
- "8080:80"
environment:
KMAGIC_ALLOW_TOPIC_DELETE: "true"
KMAGIC_ALLOW_SCHEMA_DELETE: "true"
Just run docker-compose up
and in your browser navigate to http://localhost:8080 to see the Kafka Magic UI.
In the UI click ‘Register New’ button and register your dev cluster with these two parameters:
kafka:9092
http://schema:8081
That’s it. You are ready to try some scenarios, discover Kafka capabilities, prepare for serious work with Kafka Magic tool.