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
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)
- Load templates
- Run Druid stack with defaults
- Customize configuration (recommended via inheritance)
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
variablesinstack.yml, thenmonk load MANIFESTand run.
http://localhost:8888 (router) or query the broker at http://localhost:8082.
Configuration
Key variables you can customize in this template:${monk-volume-path}/druid on the host.
Stack components
The Druid stack includes the following runnables:druid/coordinator- Cluster management and segment assignmentdruid/broker- Query routing and result mergingdruid/router- HTTP request routingdruid/historical- Segment storage and queryingdruid/middlemanager- Task execution and ingestiondruid/db- PostgreSQL metadata storagedruid/dzookeeper- ZooKeeper coordination
Use by inheritance (recommended for apps)
Inherit the Druid stack in your application and declare connections. Example: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:
routeron TCP port8888(web console) - Service:
brokeron TCP port8082(query API) - Service:
coordinatoron TCP port8081 - Service:
historicalon TCP port8083 - Service:
middlemanageron TCP port8091 - 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.
Related templates
- 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_passwordbut 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"