Skip to main content

Overview

This template provides a production‑ready Apache Druid stack as a Monk runnable. You can:
  • Run it directly to get a managed Druid deployment with all necessary components
  • Inherit it in your own stack to seamlessly add real-time analytics capabilities
Apache Druid is a high-performance real-time analytics database designed for workflows where fast queries and ingest really matter. It excels at powering UIs, running operational (ad-hoc) queries, or handling high concurrency workloads.

What this template manages

  • Druid coordinator (cluster management)
  • Druid broker (query routing)
  • Druid router (HTTP routing)
  • Druid historical (segment serving)
  • Druid middlemanager (task execution)
  • PostgreSQL database (metadata storage)
  • ZooKeeper (coordination)

Quick start (run directly)

  1. Load templates
  1. Run Druid stack with defaults
  1. Customize configuration (recommended via inheritance)
Running directly uses the defaults defined in this template’s variables. Secrets added with monk secrets add will not affect this runnable unless you inherit it and reference those secrets.
  • Preferred: inherit and replace variables with secret("...") as shown below.
  • Alternative: fork/clone and edit the variables in stack.yml, then monk load MANIFEST and run.
Once started, access the Druid console at http://localhost:8888 (router) or query the broker at http://localhost:8082.

Configuration

Key variables you can customize in this template:
Data and deep storage are persisted under ${monk-volume-path}/druid on the host.

Stack components

The Druid stack includes the following runnables:
  • druid/coordinator - Cluster management and segment assignment
  • druid/broker - Query routing and result merging
  • druid/router - HTTP request routing
  • druid/historical - Segment storage and querying
  • druid/middlemanager - Task execution and ingestion
  • druid/db - PostgreSQL metadata storage
  • druid/dzookeeper - ZooKeeper coordination
Inherit the Druid stack in your application and declare connections. Example:
Then set the secrets once and run your app group:

Features

  • Real-time Ingestion: Ingest streaming data with exactly-once semantics
  • Fast Queries: Sub-second queries on large datasets
  • Scalable: Horizontally scalable architecture
  • Column-oriented: Efficient storage and query execution
  • Multi-tenant: Supports multiple tenants and workloads
  • SQL Support: Query using SQL or native queries

Ports and connectivity

  • Service: router on TCP port 8888 (web console)
  • Service: broker on TCP port 8082 (query API)
  • Service: coordinator on TCP port 8081
  • Service: historical on TCP port 8083
  • Service: middlemanager on TCP port 8091
  • From other runnables in the same process group, use connection-hostname("\<connection-name>") to resolve the service host.

Persistence and configuration

  • Deep storage path: ${monk-volume-path}/druid:/opt/shared
  • PostgreSQL data: ${monk-volume-path}/postgresql:/var/lib/postgresql/data
  • ZooKeeper data: ${monk-volume-path}/zookeeper:/data
  • You can adjust JVM settings and Druid configuration through the template variables.
  • See other templates in this repository for complementary services
  • Combine with monitoring tools (prometheus-grafana/) for observability
  • Integrate with your application stack as needed

Troubleshooting

  • Ensure all required ports are available (8081-8083, 8088, 8091, 8888)
  • Druid requires ZooKeeper and metadata storage (PostgreSQL) to be running first
  • If you changed metadata_storage_connector_password but the database has existing data, authentication may fail. Either reset the data volume or update the password in PostgreSQL.
  • Ensure the host volumes are writable by the container user
  • Check logs for any component:
  • Verify JVM settings are appropriate for your workload
  • Ensure sufficient memory is available for the configured heap sizes
  • For single-node deployments, use single_node: "micro-quickstart" or "small"