Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting only particular process #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
FROM ubuntu:14.04

# Set version and github repo which you want to build from
ENV GITHUB_OWNER druid-io
ENV DRUID_VERSION 0.9.2
ENV ZOOKEEPER_VERSION 3.4.9

# Java 8
RUN apt-get update \
&& apt-get install -y software-properties-common \
Expand All @@ -25,11 +20,17 @@ RUN wget -q -O - http://archive.apache.org/dist/maven/maven-3/3.2.5/binaries/apa
&& ln -s /usr/local/apache-maven-3.2.5 /usr/local/apache-maven \
&& ln -s /usr/local/apache-maven/bin/mvn /usr/local/bin/mvn




# Zookeeper
ENV ZOOKEEPER_VERSION 3.4.9
RUN wget -q -O - http://www.us.apache.org/dist/zookeeper/zookeeper-$ZOOKEEPER_VERSION/zookeeper-$ZOOKEEPER_VERSION.tar.gz | tar -xzf - -C /usr/local \
&& cp /usr/local/zookeeper-$ZOOKEEPER_VERSION/conf/zoo_sample.cfg /usr/local/zookeeper-$ZOOKEEPER_VERSION/conf/zoo.cfg \
&& ln -s /usr/local/zookeeper-$ZOOKEEPER_VERSION /usr/local/zookeeper



# Druid system user
RUN adduser --system --group --no-create-home druid \
&& mkdir -p /var/lib/druid \
Expand All @@ -38,9 +39,13 @@ RUN adduser --system --group --no-create-home druid \
# Druid (from source)
RUN mkdir -p /usr/local/druid/lib

# Set version and github repo which you want to build from
ENV GITHUB_OWNER druid-io
ENV DRUID_VERSION 0.10.1
# trigger rebuild only if branch changed
ADD https://api.github.com/repos/$GITHUB_OWNER/druid/git/refs/heads/$DRUID_VERSION druid-version.json
RUN git clone -q --branch $DRUID_VERSION --depth 1 https://github.com/$GITHUB_OWNER/druid.git /tmp/druid
ADD conf-quickstart /tmp/druid/examples/conf-quickstart
WORKDIR /tmp/druid

# package and install Druid locally
Expand Down Expand Up @@ -76,6 +81,18 @@ RUN /etc/init.d/mysql start \

# Setup supervisord
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD broker-supervisord.conf /etc/supervisor/conf.d/broker-supervisord.conf
ADD coordinator-supervisord.conf /etc/supervisor/conf.d/coordinator-supervisord.conf
ADD historical-supervisord.conf /etc/supervisor/conf.d/historical-supervisord.conf
ADD middleManager-supervisord.conf /etc/supervisor/conf.d/middleManager-supervisord.conf
ADD mysql-supervisord.conf /etc/supervisor/conf.d/mysql-supervisord.conf
ADD overlord-supervisord.conf /etc/supervisor/conf.d/overlord-supervisord.conf
ADD zookeeper-supervisord.conf /etc/supervisor/conf.d/zookeeper-supervisord.conf

#setup start script
ADD start.sh /bin/start
RUN chmod a+x /bin/start


# Expose ports:
# - 8081: HTTP (coordinator)
Expand All @@ -92,4 +109,4 @@ EXPOSE 3306
EXPOSE 2181 2888 3888

WORKDIR /var/lib/druid
ENTRYPOINT export HOSTIP="$(resolveip -s $HOSTNAME)" && exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
CMD /bin/start all
19 changes: 19 additions & 0 deletions broker-supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

;
; config for broker
;

[program:druid-broker]
user=druid
command=java
-server
-Xmx1g
-Duser.timezone=UTC
-Dfile.encoding=UTF-8
-Ddruid.host=%(ENV_HOSTIP)s
-Ddruid.computation.buffer.size=67108864
-Ddruid.broker.cache.sizeInBytes=33554432
-cp /usr/local/druid/lib/*
io.druid.cli.Main server broker
redirect_stderr=true
priority=100
118 changes: 118 additions & 0 deletions conf-quickstart/druid/_common/common.runtime.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#
# Licensed to Metamarkets Group Inc. (Metamarkets) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Metamarkets licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

# Extensions specified in the load list will be loaded by Druid
# We are using local fs for deep storage - not recommended for production - use S3, HDFS, or NFS instead
# We are using local derby for the metadata store - not recommended for production - use MySQL or Postgres instead

# If you specify `druid.extensions.loadList=[]`, Druid won't load any extension from file system.
# If you don't specify `druid.extensions.loadList`, Druid will load all the extensions under root extension directory.
# More info: http://druid.io/docs/latest/operations/including-extensions.html
druid.extensions.loadList=[]

# If you have a different version of Hadoop, place your Hadoop client jar files in your hadoop-dependencies directory
# and uncomment the line below to point to your directory.
#druid.extensions.hadoopDependenciesDir=/my/dir/hadoop-dependencies

#
# Logging
#

# Log all runtime properties on startup. Disable to avoid logging properties on startup:
druid.startup.logging.logProperties=true

#
# Zookeeper
#

druid.zk.service.host=localhost
druid.zk.paths.base=/druid

#
# Metadata storage
#

# For Derby server on your Druid Coordinator (only viable in a cluster with a single Coordinator, no fail-over):
druid.metadata.storage.type=derby
druid.metadata.storage.connector.connectURI=jdbc:derby://localhost:1527/var/druid/metadata.db;create=true
druid.metadata.storage.connector.host=localhost
druid.metadata.storage.connector.port=1527

# For MySQL:
#druid.metadata.storage.type=mysql
#druid.metadata.storage.connector.connectURI=jdbc:mysql://db.example.com:3306/druid
#druid.metadata.storage.connector.user=...
#druid.metadata.storage.connector.password=...

# For PostgreSQL:
#druid.metadata.storage.type=postgresql
#druid.metadata.storage.connector.connectURI=jdbc:postgresql://db.example.com:5432/druid
#druid.metadata.storage.connector.user=...
#druid.metadata.storage.connector.password=...

#
# Deep storage
#

# For local disk (only viable in a cluster if this is a network mount):
druid.storage.type=local
druid.storage.storageDirectory=var/druid/segments

# For HDFS:
#druid.storage.type=hdfs
#druid.storage.storageDirectory=/druid/segments

# For S3:
#druid.storage.type=s3
#druid.storage.bucket=your-bucket
#druid.storage.baseKey=druid/segments
#druid.s3.accessKey=...
#druid.s3.secretKey=...

#
# Indexing service logs
#

# For local disk (only viable in a cluster if this is a network mount):
druid.indexer.logs.type=file
druid.indexer.logs.directory=var/druid/indexing-logs

# For HDFS:
#druid.indexer.logs.type=hdfs
#druid.indexer.logs.directory=/druid/indexing-logs

# For S3:
#druid.indexer.logs.type=s3
#druid.indexer.logs.s3Bucket=your-bucket
#druid.indexer.logs.s3Prefix=druid/indexing-logs

#
# Service discovery
#

druid.selectors.indexing.serviceName=druid/overlord
druid.selectors.coordinator.serviceName=druid/coordinator

#
# Monitoring
#

druid.monitoring.monitors=["com.metamx.metrics.JvmMonitor"]
druid.emitter=logging
druid.emitter.logging.logLevel=info
33 changes: 33 additions & 0 deletions conf-quickstart/druid/_common/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ Licensed to Metamarkets Group Inc. (Metamarkets) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. Metamarkets licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->

<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{ISO8601} %p [%t] %c - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

8 changes: 8 additions & 0 deletions conf-quickstart/druid/broker/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-server
-Xms1g
-Xmx1g
-XX:MaxDirectMemorySize=1792m
-Duser.timezone=UTC
-Dfile.encoding=UTF-8
-Djava.io.tmpdir=var/tmp
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
16 changes: 16 additions & 0 deletions conf-quickstart/druid/broker/runtime.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
druid.service=druid/broker
druid.port=8082

# HTTP server threads
druid.broker.http.numConnections=5
druid.server.http.numThreads=9

# Processing threads and buffers
druid.processing.buffer.sizeBytes=256000000
druid.processing.numThreads=2

# Query cache (we use a small local cache)
druid.broker.cache.useCache=true
druid.broker.cache.populateCache=true
druid.cache.type=local
druid.cache.sizeInBytes=10000000
8 changes: 8 additions & 0 deletions conf-quickstart/druid/coordinator/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-server
-Xms256m
-Xmx256m
-Duser.timezone=UTC
-Dfile.encoding=UTF-8
-Djava.io.tmpdir=var/tmp
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
-Dderby.stream.error.file=var/druid/derby.log
5 changes: 5 additions & 0 deletions conf-quickstart/druid/coordinator/runtime.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
druid.service=druid/coordinator
druid.port=8081

druid.coordinator.startDelay=PT10S
druid.coordinator.period=PT5S
8 changes: 8 additions & 0 deletions conf-quickstart/druid/historical/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-server
-Xms1g
-Xmx1g
-XX:MaxDirectMemorySize=1280m
-Duser.timezone=UTC
-Dfile.encoding=UTF-8
-Djava.io.tmpdir=var/tmp
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
13 changes: 13 additions & 0 deletions conf-quickstart/druid/historical/runtime.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
druid.service=druid/historical
druid.port=8083

# HTTP server threads
druid.server.http.numThreads=9

# Processing threads and buffers
druid.processing.buffer.sizeBytes=256000000
druid.processing.numThreads=2

# Segment storage
druid.segmentCache.locations=[{"path":"var/druid/segment-cache","maxSize"\:300000000000}]
druid.server.maxSize=300000000000
7 changes: 7 additions & 0 deletions conf-quickstart/druid/middleManager/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-server
-Xms64m
-Xmx64m
-Duser.timezone=UTC
-Dfile.encoding=UTF-8
-Djava.io.tmpdir=var/tmp
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
20 changes: 20 additions & 0 deletions conf-quickstart/druid/middleManager/runtime.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
druid.service=druid/middleManager
druid.port=8091

# Number of tasks per middleManager
druid.worker.capacity=3

# Task launch parameters
druid.indexer.runner.javaOpts=-server -Xmx2g -Duser.timezone=UTC -Dfile.encoding=UTF-8 -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
druid.indexer.task.baseTaskDir=var/druid/task

# HTTP server threads
druid.server.http.numThreads=9

# Processing threads and buffers
druid.processing.buffer.sizeBytes=256000000
druid.processing.numThreads=2

# Hadoop indexing
druid.indexer.task.hadoopWorkingPath=var/druid/hadoop-tmp
druid.indexer.task.defaultHadoopCoordinates=["org.apache.hadoop:hadoop-client:2.7.3"]
7 changes: 7 additions & 0 deletions conf-quickstart/druid/overlord/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-server
-Xms256m
-Xmx256m
-Duser.timezone=UTC
-Dfile.encoding=UTF-8
-Djava.io.tmpdir=var/tmp
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
7 changes: 7 additions & 0 deletions conf-quickstart/druid/overlord/runtime.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
druid.service=druid/overlord
druid.port=8090

druid.indexer.queue.startDelay=PT5S

druid.indexer.runner.type=remote
druid.indexer.storage.type=metadata
Loading