Docker

    Before beginning the quickstart, it is helpful to read the general Druid overview and the , as the tutorials will refer to concepts discussed on those pages. Additionally, familiarity with Docker is recommended.

    • Docker

    The Druid source code contains an example which can pull an image from Docker Hub and is suited to be used as an example environment and to experiment with Docker based Druid configuration and deployments.

    The example docker-compose.yml will create a container for each Druid service, as well as Zookeeper and a PostgreSQL container as the metadata store. Deep storage will be a local directory, by default configured as ./storage relative to your docker-compose.yml file, and will be mounted as /opt/data and shared between Druid containers which require access to deep storage. The Druid containers are configured via an .

    Configuration

    Configuration of the Druid Docker container is done via environment variables, which may additionally specify paths to

    Special environment variables:

    • JAVA_OPTS — set java options
    • DRUID_LOG4J — set the entire log4j.xml verbatim
    • DRUID_LOG_LEVEL — override the default log level in default log4j
    • — set Java Xmx
    • DRUID_MAXNEWSIZE — set Java max new size
    • DRUID_NEWSIZE — set Java new size
    • DRUID_MAXDIRECTMEMORYSIZE — set Java max direct memory size
    • DRUID_CONFIG_COMMON — full path to a file for druid ‘common’ properties
    • DRUID_CONFIG_${service} — full path to a file for druid ‘service’ properties

    druid_metadata_storage_type=postgresql

    would be translated into

    -Ddruid.metadata.storage.type=postgresql

    for the Druid process in the container.

    The Druid docker-compose.yml example utilizes a single environment file to specify the complete Druid configuration; however, in production use cases we suggest using either DRUID_COMMON_CONFIG and DRUID_CONFIG_${service} or specially tailored, service-specific environment files.

    Once the cluster has started, you can navigate to http://localhost:8888. The , which serves the Druid console, resides at this address.

    It takes a few seconds for all the Druid processes to fully start up. If you open the console immediately after starting the services, you may see some errors that you can safely ignore.

    From here you can follow along with the , or elaborate on your to add any additional external service dependencies as necessary.

    If you experience any processes crashing with a 137 error code you likely don’t have enough memory allocated to Docker. 6 GB may be a good place to start.