NOTE: we are no longer using Druid, and therefore we are no longer supporting this repository or any Docker images built from it. It only remains on github as a reference for others. If you'd like to take over this repo, please open an issue.
Example of running Druid broker, coordinator, historical and overlord nodes in separate Docker containers, along with Zookeeper and Postgres in their own Docker containers, all wired together via fig.
An eventual goal of this project is to provide Docker images for all of the Druid node types as automated builds on https://hub.docker.com.
NOTE: this is very much a work-in-progress and learning exercise.

./build.sh
fig up -d druid
cd random-tranquility
sbt run
All Druid nodes (broker, coordinator, historical and overlord) should start up pretty quickly. Check the logs of any node using fig logs [nodeType], e.g. fig logs druidcoordinator1 or fig logs druidoverlord1.
Once the coordinator is up, its web console should be accesible at http://192.168.59.103:8081.
Once the overlord is up, its web console should be accessible at http://192.168.59.103:8085/console.html.
Send queries to the broker at http://192.168.59.103:8082/druid/v2/. Some example queries are provided, e.g.:
cd query
./query.sh random-counts.json
To shut everything down: fig kill && fig rm --force
./build.sh
fig up -d druid
http://hadoop.dev.banno.com:50070 and wait for safe mode to be turned off, takes about 30 secs
execute stuff in druid-pageviews/hdfs-commands to get data file into hdfs
./ingest.sh task5-hadoop.json <========== exec this in druid-pageviews to start hadoop index task
http://192.168.59.103:8085/console.html to make sure task is running, and check its logs
http://hadoop.dev.banno.com:8088 to check druid mapreduce job in yarn ui
Druid node types:
Each node is launched in basically the same way. An argument of nodeType determines which type of node it will be:
java ... io.druid.cli.Main server [nodeType]
There should probably one base Docker image containing a Druid "stem cell", and then a separate Docker image for each specific node type. Each Druid Docker container should only
run a single Druid node process and nothing else. Entrypoint should run the node's java command. Configuration needs to be customizable via environment variables.
May also make sense to support other ways of using custom configuration files (instead of only env vars) such as sub-images, shared volumes, etc. Druid does not seem to support
config values in property files being overriden by env vars, so it might be OK to support a few env var overrides (i.e. by doing -Dsome.druid.property=$SOME_ENV_VAR) but
heavy customization should probably be done in property files added to sub-images.
External dependencies such as Zookeeper, metadata storage (e.g. Postgres) and deep storage (e.g. HDFS) should be fully external; these should absolutely not be running in any Druid Docker container. Setting up a "distributed" Druid cluster should be coordinated via a fig.yml.
The Docker images created in this repository should be completely generic and non-Banno-specific. We can add our own sidecars around these Docker images separately, in a private repository.
Docker images:
The "simpler" setup uses Realtime nodes instead of Indexers (overlord and middle-manager):
The more complex option uses Indexers instead of Realtime nodes:
druid-base image:
druid.x into common.runtime.propertiesDRUID_JAVA_OPTIONS env varjava ... io.druid.cli.Main tools pull-depsdruid-[nodeType] images:
exec java ... [nodeType]fig.yml:
Druid will load files named common.runtime.properties and runtime.properties that it finds on the classpath. There is also a config druid.properties.file that Druid might use
if it can't find one of those files, not really sure though...
It is not possible to use environment variables in Druid's .properties files.
Druid does allow system properties to override configs in the .properties files, so you can do something like java ... -Dsome.druid.config=$SOME_ENV_VAR .... One downside of doing this is then
SOME_ENV_VAR must always be set, and cannot be optional.
One approach to using env vars in .properties files is to have a "sidecar" shell script as the Docker image's ENTRYPOINT, which takes all env vars named DRUID_X_Y, convert them into strings like x.y=value and then replace/append those into the .properties file using e.g. sed. That script would then run the Druid java command. Care must be taken with this approach so that any signals (e.g. SIGTERM) get sent to the java process and not to the shell script (probably need to use exec).
Another option is to create generic base images using the stock .properties files, and then create sub-images with the actual .properties files to use overwriting the stock ones. A downside of this approach is that all config values are hard-coded and cannot be dynamic (e.g. random port chosen by Marathon). This also leads to creating separate Docker images for different environments, e.g. staging and production.
Lowest barrier-to-entry for running Druid on Mesos is probably to tell Marathon to run all of the nodes
Each Druid node type has its own Docker image, so will need its own Marathon application
Do we need to constrain where marathon runs the node types?
Can we use standard Druid port numbers? Or do we need to use Marathon-assigned random ports?
What about other config?
druid_x_y_z to override any configs like druid.x.y.z we can just use env vars in marathon jsonObservations running 2 of each node type:
Definitely need to test failover:
Special considerations when running on Mesos locally in boot2docker:
Content type
Image
Digest
sha256:bab8a7804…
Size
361 MB
Last updated
about 10 years ago
docker pull banno/druid-coordinator