Installation Guide: Docker

Created with Sketch.
Download / Installation-Guide /Docker

Running the Metatron Docker image

We provide docker image for easy-installation of Metatron Discovery and the druid customized engine. To run this docker image, you only need linux command window! For now, we support simple download for single mode of druid only. Please contact us if you specially need the distributed version.

Prerequisites

Metatron Docker repository

https://hub.docker.com/r/metatronapp/discovery/tags/

Execute the docker image

To run the docker image in quickstart mode(single-machine, non-clustered), execute the following command to run.

docker run -i -d --rm -m 6G -p ${HOST_DISCOVERY_PORT:=8180}:8180 \--name metatron-discovery metatronapp/discovery:latest

To access the logs and service of druid or mariadb in docker container, expose the service’s ports and log path.

-p ${HOST_BROKER_PORT:=8081}:8081
-p ${HOST_HISTORICAL_PORT:=8083}:8083
-p ${HOST_OVERLORD_PORT:=8090}:8090
-p ${HOST_MIDDLEMANAGER_PORT:=8091}:8091
-v ${HOST_DRUID_LOGS_PATH:="./logs/druid"}:/usr/local/druid/logs
-v ${HOST_DISCOVERY_LOGS_PATH:="./logs/discovery"}:/usr/local/metatron-discovery/logs

To enter the container, if you want:

docker exec -it metatron-discovery /bin/bash

To stop the container, if you want:

docker stop metatron-discovery

To access Metatron Discovery, go to http://localhost:${HOST_DISCOVERY_PORT:=8180}. (The default admin user account is provided as Username: admin, PW: admin)

How to persist data in Metatron docker container

By default, the docker does not store data. For some reason when you need to redistribute containers, all the data is initialized. This can cause considerable stress, so we suggest ways to preserve Metatron data within docker environment.

There are two paths to be preserved in the container:

  • /usr/local/druid-backup
  • /usr/local/mysql-backup

So, if you want to persist your data, you have to add volume (-v) options as follow :

-v {HOST_DIR_FOR_DRUID_DATA}:/usr/local/druid-backup
-v {HOST_DIR_FOR_MYSQL_DATA}:/usr/local/mysql-backup

For instance, if you run a container with these options :

docker run -i -d --rm -m 6G -p ${HOST_DISCOVERY_PORT:=8180}:8180 \
-v /apps/host_volume/druid:/usr/local/druid-backup \
-v /apps/host_volume/mysql:/usr/local/mysql-backup \
--name metatron-discovery metatronapp/discovery:latest

Then you can see the data on the host’s directory and now can re-use the data when you run a new container.

  • If you are using docker on Mac OS, you have to set mount point in the ‘Preferences’ > ‘File Sharing’

One more important thing is the option for running Metatron Discovery application.

By default, Metatron Discovery run with –init option for docker container for initialize the database per every users. It is necessary for the first execution.

So, if you decide to keep the data, you must add a new environment variable from the next time you run it.

-	PERSIST_DISCOVERY=TRUE

Except for the very first time, please be sure to include this setting.

Finally, you can run a container with these options for persist data.

-v {HOST_DIR_FOR_DRUID}:/usr/local/druid-backup \
-v {HOST_DIR_FOR_MYSQL}:/usr/local/mysql-backup \
-e PERSIST_DISCOVERY=TRUE
  • ‘PERSIST_DISCOVERY=TRUE’ option is required from the second run. It must be omitted for the first time in your entire environment.

At first, persist the data by just setting up the volume (-v), then add environment (-e) setting from the next run.