Add script start-zeppelin to zeppelin-base

This commit is contained in:
mahmoudelgamal 2016-11-18 11:24:39 +02:00
parent d2c744e3ce
commit 1f093d47d0
4 changed files with 83 additions and 6 deletions

View file

@ -120,9 +120,9 @@ function make_binary_release() {
rm -rf "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
}
build_docker_base
git_clone
make_source_package
build_docker_base
make_binary_release all "-Pspark-2.0 -Phadoop-2.4 -Pyarn -Ppyspark -Psparkr -Pr -Pscala-2.11"
make_binary_release netinst "-Pspark-2.0 -Phadoop-2.4 -Pyarn -Ppyspark -Psparkr -Pr -Pscala-2.11 -pl !alluxio,!angular,!cassandra,!elasticsearch,!file,!flink,!hbase,!ignite,!jdbc,!kylin,!lens,!livy,!markdown,!postgresql,!python,!shell,!bigquery"

View file

@ -44,21 +44,27 @@ You need to [install docker](https://docs.docker.com/engine/installation/) on yo
```
docker pull ${DOCKER_USERNAME}/zeppelin-release:<release-version>
docker run --rm -it -p 7077:7077 -p 8081:8081 ${DOCKER_USERNAME}/zeppelin-release:<release-version> -c bash
docker run --rm -it -p 7077:7077 -p 8080:8080 ${DOCKER_USERNAME}/zeppelin-release:<release-version> -c bash
```
* Then a docker container will start with a Zeppelin release on path :
`/usr/local/zeppelin/`
* Run zeppelin inside docker:
```
/usr/local/zeppelin/bin/zeppelin-daemon start
start-zeppelin.sh start
```
* To Run Zeppelin in daemon mode
* To Run Zeppelin in daemon mode
Mounting logs and notebooks zeppelin to folders on your host machine
```
docker run -d -p 7077:7077 -p 8081:8081 ${DOCKER_USERNAME}/zeppelin-release:<release-version> \
bash -c "/usr/local/zeppelin/bin/zeppelin-daemon.sh restart && while true; do sleep 3; done"
docker run -p 7077:7077 -p 8080:8080 --privileged=true -v $PWD/logs:/logs -v $PWD/notebook:/notebook \
-e ZEPPELIN_NOTEBOOK_DIR='/notebook' \
-e ZEPPELIN_LOG_DIR='/logs' \
-d ${DOCKER_USERNAME}/zeppelin-release:<release-version> \
bash -c "start-zeppelin.sh restart && while true; do sleep 3; done"
```
* Zeppelin will run at `http://localhost:8080`.

View file

@ -45,6 +45,9 @@ RUN apk add --update bash curl openjdk7-jre wget ca-certificates python build-ba
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64
RUN chmod +x /usr/local/bin/dumb-init
ADD start-zeppelin.sh /usr/bin/start-zeppelin.sh
RUN chmod a+x /usr/bin/start-zeppelin.sh
# ports for zeppelin
EXPOSE 8080 7077

View file

@ -0,0 +1,68 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF 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.
#
#
USAGE="-e Usage: start-zepppelin.sh {start|stop|restart}\n\t"
if [[ -z "$ZEPPELIN_MEM" ]]; then
export ZEPPELIN_MEM="-Xmx1024m -XX:MaxPermSize=512m"
fi
if [[ -z "$ZEPPELIN_INTP_MEM" ]]; then
export ZEPPELIN_INTP_MEM=$ZEPPELIN_MEM
fi
if [[ -z "$ZEPPELIN_JAVA_OPTS" ]]; then
# By default N/A
export ZEPPELIN_JAVA_OPTS=""
fi
if [[ -z "$ZEPPELIN_NOTEBOOK_DIR" ]]; then
export ZEPPELIN_NOTEBOOK_DIR="/usr/local/zeppelin/notebook"
fi
if [[ -z "$ZEPPELIN_LOG_DIR" ]]; then
export ZEPPELIN_LOG_DIR="/usr/local/zeppelin/logs"
fi
if [[ -z "$ZEPPELIN_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE" ]]; then
export ZEPPELIN_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE=1024000
fi
export ZEPPELIN_PORT=8080
export ZEPPELIN_HOME="/usr/local/zeppelin"
function start(){
${ZEPPELIN_HOME}/bin/zeppelin-daemon.sh start
}
function stop(){
${ZEPPELIN_HOME}/bin/zeppelin-daemon.sh stop
}
case "${1}" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo ${USAGE}
esac