로컬 개발 환경 구축

Docker를 사용하여 로컬 개발 환경을 구축해보자

Requirements

  • Docker

  • Zookeeper

  • Metadata Store(MySQL)

Dockerfile

FROM ubuntu:xenial

MAINTAINER yunseop.song <yunseop.song@ab180.co>

# Druid Version
ENV DRUID_VERSION 0.10.1
ENV JAVA_HOME       /opt/jre1.8.0_40
ENV PATH            $PATH:/opt/jre1.8.0_40/bin

# Druid env variable
ENV DRUID_XMX           '-'
ENV DRUID_XMS           '-'
ENV DRUID_NEWSIZE       '-'
ENV DRUID_MAXNEWSIZE    '-'
ENV DRUID_HOSTNAME      '-'
ENV DRUID_LOGLEVEL      '-'

RUN apt-get update -y \
    && apt-get install -y wget tar bash \
    && mkdir /tmp/druid

# Java 8
RUN apt-get update \
    && apt-get install -y software-properties-common \
    && apt-add-repository -y ppa:webupd8team/java \
    && apt-get purge --auto-remove -y software-properties-common \
    && apt-get update \
    && echo oracle-java-8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections \
    && apt-get install -y oracle-java8-installer oracle-java8-set-default \
                        git \
    && apt-get clean \
    && rm -rf /var/cache/oracle-jdk8-installer \
    && rm -rf /var/lib/apt/lists/*

# Druid
RUN wget -q --no-check-certificate --no-cookies -O - \
    http://static.druid.io/artifacts/releases/druid-$DRUID_VERSION-bin.tar.gz | tar -xzf - -C /opt \
    && ln -s /opt/druid-$DRUID_VERSION /opt/druid

# Druid Configuration
COPY conf /opt/druid-$DRUID_VERSION/conf

# Extension mysql-metadata-storage
COPY extensions/mysql-metadata-storage /opt/druid-$DRUID_VERSION/extensions/mysql-metadata-storage

# Add docker-entrypoint.sh
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# COPY data /opt/druid-$DRUID_VERSION/data

# Create tmp directory
RUN mkdir -p /tmp/druid

# Expose ports:
# - 8081: HTTP (coordinator)
# - 8082: HTTP (broker)
# - 8083: HTTP (historical)
# - 8090: HTTP (overlord)
# - 8091: HTTP (middleManager)
EXPOSE 8081
EXPOSE 8082
EXPOSE 8083
EXPOSE 8090
EXPOSE 8091

ENTRYPOINT ["/docker-entrypoint.sh"]

Issue

  • 인덱스 생성에 성공은 했으나 콘솔에서 빨간색 Historial Node 의 로그를 보니

Caused by: java.lang.IllegalArgumentException: [/tmp/druid/localStorage/mobile-app-event-results-test-001/2018-04-04T00:00:00.000Z_2018-04-05T00:00:00.000Z/2018-04-06T08:23:23.156Z/0/index.zip] does not exist

뒤져보니 middleManager Node 에 있는??? 왤까…