mirror of https://github.com/apache/druid.git
Adds init scripts (#2939)
This commit is contained in:
parent
45b2e65d75
commit
13a2b265a5
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash -eu
|
||||
|
||||
usage="Usage: broker.sh (start|stop)"
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo $usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sh ./bin/node.sh broker $1
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash -eu
|
||||
|
||||
usage="Usage: coordinator.sh (start|stop)"
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo $usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sh ./bin/node.sh coordinator $1
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash -eu
|
||||
|
||||
usage="Usage: historical.sh (start|stop)"
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo $usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sh ./bin/node.sh historical $1
|
|
@ -4,9 +4,11 @@ gzip -c -d quickstart/wikiticker-2015-09-12-sampled.json.gz > "quickstart/wikiti
|
|||
|
||||
LOG_DIR=var
|
||||
|
||||
mkdir log
|
||||
mkdir -p $LOG_DIR/tmp;
|
||||
mkdir -p $LOG_DIR/druid/indexing-logs;
|
||||
mkdir -p $LOG_DIR/druid/segments;
|
||||
mkdir -p $LOG_DIR/druid/segment-cache;
|
||||
mkdir -p $LOG_DIR/druid/task;
|
||||
mkdir -p $LOG_DIR/druid/hadoop-tmp;
|
||||
mkdir -p $LOG_DIR/druid/pids;
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash -eu
|
||||
|
||||
usage="Usage: middleManager.sh (start|stop)"
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo $usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sh ./bin/node.sh middleManager $1
|
|
@ -0,0 +1,56 @@
|
|||
#!/bin/bash -eu
|
||||
|
||||
## Initializtion script for druid nodes
|
||||
## Runs druid nodes as a daemon and pipes logs to log/ directory
|
||||
|
||||
usage="Usage: node.sh nodeType (start|stop)"
|
||||
|
||||
if [ $# -le 1 ]; then
|
||||
echo $usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nodeType=$1
|
||||
shift
|
||||
|
||||
startStop=$1
|
||||
pid=var/druid/pids/$nodeType.pid
|
||||
|
||||
case $startStop in
|
||||
|
||||
(start)
|
||||
|
||||
if [ -f $pid ]; then
|
||||
if kill -0 `cat $pid` > /dev/null 2>&1; then
|
||||
echo $nodeType node running as process `cat $pid`. Stop it first.
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
nohup java `cat conf/druid/$nodeType/jvm.config | xargs` -cp conf/druid/_common:conf/druid/$nodeType:lib/* io.druid.cli.Main server $nodeType > log/$nodeType.log &
|
||||
nodeType_PID=$!
|
||||
echo $nodeType_PID > $pid
|
||||
echo "Started $nodeType node ($nodeType_PID)"
|
||||
;;
|
||||
|
||||
(stop)
|
||||
|
||||
if [ -f $pid ]; then
|
||||
TARGET_PID=`cat $pid`
|
||||
if kill -0 $TARGET_PID > /dev/null 2>&1; then
|
||||
echo Stopping process `cat $pid`...
|
||||
kill $TARGET_PID
|
||||
else
|
||||
echo No $nodeType node to stop
|
||||
fi
|
||||
rm -f $pid
|
||||
else
|
||||
echo No $nodeType node to stop
|
||||
fi
|
||||
;;
|
||||
|
||||
(*)
|
||||
echo $usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash -eu
|
||||
|
||||
usage="Usage: overlord.sh (start|stop)"
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo $usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sh ./bin/node.sh overlord $1
|
Loading…
Reference in New Issue