kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [21/23] incubator-kylin git commit: merge critical bug fixes, refine deploy script
Date Tue, 03 Mar 2015 09:59:25 GMT
merge critical bug fixes, refine deploy script


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/4501a04a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/4501a04a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/4501a04a

Branch: refs/heads/master
Commit: 4501a04a0bb2c77f6713146abf34641a787315d6
Parents: cd38b9a
Author: lukehan <lukehan@apache.org>
Authored: Wed Feb 11 23:04:21 2015 +0800
Committer: lukehan <lukehan@apache.org>
Committed: Wed Feb 11 23:04:21 2015 +0800

----------------------------------------------------------------------
 kylin.sh          |   8 +--
 sandbox_deploy.sh | 172 -------------------------------------------------
 2 files changed, 4 insertions(+), 176 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4501a04a/kylin.sh
----------------------------------------------------------------------
diff --git a/kylin.sh b/kylin.sh
index 43a4614..0e0f5aa 100755
--- a/kylin.sh
+++ b/kylin.sh
@@ -23,15 +23,15 @@ fi
 #hbase command will do all the dirty tasks for us:
 if [ "$1" = "start" ] ; then
         export HBASE_CLASSPATH_PREFIX=/etc/kylin:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar:${CATALINA_HOME}/lib/*:$HBASE_CLASSPATH_PREFIX
-        hbase  -XX:PermSize=256M -XX:MaxPermSize=512M -Djava.util.logging.config.file=${CATALINA_HOME}/conf/logging.properties
-Djava.library.path=${KYLIN_LD_LIBRARY_PATH} -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true
-Dspring.profiles.active=sandbox -Djava.endorsed.dirs=${CATALINA_HOME}/endorsed  -Dcatalina.base=${CATALINA_HOME}
-Dcatalina.home=${CATALINA_HOME} -Djava.io.tmpdir=${CATALINA_HOME}/temp  org.apache.hadoop.util.RunJar
${CATALINA_HOME}/bin/bootstrap.jar  org.apache.catalina.startup.Bootstrap start > ${CATALINA_HOME}/logs/kylin_sandbox.log
2>&1 &
+        hbase  -XX:PermSize=256M -XX:MaxPermSize=512M -Djava.util.logging.config.file=${CATALINA_HOME}/conf/logging.properties
-Djava.library.path=${KYLIN_LD_LIBRARY_PATH} -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true
-Dspring.profiles.active=sandbox -Djava.endorsed.dirs=${CATALINA_HOME}/endorsed  -Dcatalina.base=${CATALINA_HOME}
-Dcatalina.home=${CATALINA_HOME} -Djava.io.tmpdir=${CATALINA_HOME}/temp  org.apache.hadoop.util.RunJar
${CATALINA_HOME}/bin/bootstrap.jar  org.apache.catalina.startup.Bootstrap start > ${CATALINA_HOME}/logs/kylin.log
2>&1 &
         echo "A new Kylin instance is started by $USER, stop it using \"kylin.sh stop\""
-        echo "Please visit http://<your_sandbox_ip>:7070/kylin to play with the cubes!
(Useranme: ADMIN, Password: KYLIN)"
-        echo "You can check the log at ${CATALINA_HOME}/logs/kylin_sandbox.log"
+        echo "Please visit http://<your_hostname>:7070/kylin to play with the cubes!
(Useranme: ADMIN, Password: KYLIN)"
+        echo "You can check the log at ${CATALINA_HOME}/logs/kylin.log"
 
 elif [ "$1" = "stop" ]; then
         # kill all tomcats started by current user
         ps -fu $USER | grep tomcat | grep -v "grep" | awk '{print $2}' | xargs kill
-        echo "all tomcats started by $USER are killed"
+        echo "all tomcats started by $USER are terminated"
 
 else
         echo "Usage: \"kylin.sh start\", or \"kylin.sh stop\""

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/4501a04a/sandbox_deploy.sh
----------------------------------------------------------------------
diff --git a/sandbox_deploy.sh b/sandbox_deploy.sh
deleted file mode 100755
index 7e7e8c2..0000000
--- a/sandbox_deploy.sh
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/bin/bash
-
-set -o pipefail  # trace ERR through pipes
-set -o errtrace  # trace ERR through 'time command' and other functions
-
-function error() {
-SCRIPT="$0"           # script name
-LASTLINE="$1"         # line of error occurrence
-LASTERR="$2"          # error code
-echo "ERROR exit from ${SCRIPT} : line ${LASTLINE} with exit code ${LASTERR}"
-exit 1
-}
-
-function escape_sed_replacement(){
-        v=$1
-        v=$(sed -e 's/[\/&]/\\&/g' <<< $v)
-        echo $v
-}
-
-function escape_sed_pattern(){
-        v=$1
-        v=$(sed -e 's/[]\/$*.^|[]/\\&/g' <<< $v)
-        echo $v
-}
-
-trap 'error ${LINENO} ${?}' ERR
-
-echo ""
-echo "Welcome to use Kylin-Deploy script"
-echo "This script will help you:"
-echo "1. Check environment"
-echo "2. Build Kylin artifacts"
-echo "3. Prepare test cube related data"
-echo "Please make sure you are running this script on a hadoop CLI machine, and you have
enough permissions."
-echo "Also, We assume you have installed: JAVA, TOMCAT, NPM and MAVEN."
-echo "[Warning] The installation may break existing tomcat applications on this CLI"
-echo ""
-
-
-[[ "$SILENT" ]] || ( read -p "Are you sure you want to proceed?(press Y or y to confirm)
" -n 1 -r
-echo    # (optional) move to a new line
-if [[ ! $REPLY =~ ^[Yy]$ ]]
-then
-    echo "Not going to proceed, quit without finishing! You can rerun the script to have
another try."
-    exit 1
-fi )
-
-echo "Checking JAVA status..."
-
-if [ -z "$JAVA_HOME" ]
-then
-    echo "Please set JAVA_HOME so that Kylin-Deploy can proceed"
-    exit 1
-else
-    echo "JAVA_HOME is set to $JAVA_HOME"
-fi
-
-if [ -d "$JAVA_HOME" ]
-then
-    echo "$JAVA_HOME exists"
-else
-    echo " $JAVA_HOME does not exist or is not a directory."
-    exit 1
-fi
-
-echo "Checking tomcat status..."
-
-if [ -z "$CATALINA_HOME" ]
-then
-    echo "Please set CATALINA_HOME so that Kylin-Deploy knows where to start tomcat"
-    exit 1
-else
-    echo "CATALINA_HOME is set to $CATALINA_HOME"
-fi
-
-if [ -d "$CATALINA_HOME" ]
-then
-    echo "$CATALINA_HOME exists"
-else
-    echo " $CATALINA_HOME does not exist or is not a directory."
-    exit 1
-fi
-
-echo "Checking maven..."
-
-if [ -z "$(command -v mvn)" ]
-then
-    echo "Please install maven first so that Kylin-Deploy can proceed"
-    exit 1
-else
-    echo "maven check passed"
-fi
-
-echo "Checking npm..."
-
-if [ -z "$(command -v npm)" ]
-then
-    echo "Please install npm first so that Kylin-Deploy can proceed"
-    exit 1
-else
-    echo "npm check passed"
-fi
-
-KYLIN_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )"  && pwd )"
-echo "Kylin home folder path is $KYLIN_HOME"
-cd $KYLIN_HOME
-
-
-echo "Building and packaging..."
-source ./package.sh
-
-echo "retrieving classpath..."
-cd $KYLIN_HOME/job/target
-JOB_JAR_NAME="kylin-job-latest.jar"
-#export hbase configs, most of the configurations are useless now, but KYLIN_HBASE_CONF_PATH
is used by SampleCubeSetupAsTest now
-hbase org.apache.hadoop.util.RunJar $JOB_JAR_NAME com.kylinolap.job.deployment.HbaseConfigPrinter
/tmp/kylin_retrieve.sh
-#load config variables
-source /tmp/kylin_retrieve.sh
-
-cd $KYLIN_HOME
-mkdir -p /etc/kylin
-
-HOSTNAME=`hostname`
-DEFAULT_CHECK_URL="kylin.job.yarn.app.rest.check.status.url=http://sandbox"
-DEFAULT_SERVER_LIST="kylin.rest.servers=sandbox"
-NEW_CHECK_URL_PREFIX="kylin.job.yarn.app.rest.check.status.url=http://"
-NEW_SERVER_LIST_PREFIX="kylin.rest.servers="
-
-#escape special characters for sed
-DEFAULT_CHECK_URL=$(escape_sed_pattern $DEFAULT_CHECK_URL)
-DEFAULT_SERVER_LIST=$(escape_sed_pattern $DEFAULT_SERVER_LIST)
-NEW_CHECK_URL_PREFIX=$(escape_sed_replacement $NEW_CHECK_URL_PREFIX)
-NEW_SERVER_LIST_PREFIX=$(escape_sed_replacement $NEW_SERVER_LIST_PREFIX)
-HOSTNAME=$(escape_sed_replacement $HOSTNAME)
-
-#deploy kylin.properties to /etc/kylin
-cat examples/test_case_data/sandbox/kylin.properties | \
-    sed -e "s/${DEFAULT_CHECK_URL}/${NEW_CHECK_URL_PREFIX}${HOSTNAME}/g"  | \
-    sed -e "s/${DEFAULT_SERVER_LIST}/${NEW_SERVER_LIST_PREFIX}${HOSTNAME}/g"   >  /etc/kylin/kylin.properties
-
-cat examples/test_case_data/sandbox/kylin_job_conf.xml > /etc/kylin/kylin_job_conf.xml
-
-# 1. generate synthetic fact table(test_kylin_fact) data and dump it into hive
-# 2. create empty cubes on these data, ready to be built
-cd $KYLIN_HOME
-mvn test -Dtest=com.kylinolap.job.SampleCubeSetupAsTest -DfailIfNoTests=false
-
-#overwrite server.xml
-mv ${CATALINA_HOME}/conf/server.xml ${CATALINA_HOME}/conf/server.xml.bak
-cp deploy/server.xml ${CATALINA_HOME}/conf/server.xml
-echo "server.xml overwritten..."
-
-#deploy kylin.war
-rm -rf $CATALINA_HOME/webapps/kylin
-rm -f $CATALINA_HOME/webapps/kylin.war
-cp $KYLIN_HOME/server/target/kylin.war $CATALINA_HOME/webapps/
-chmod 644 $CATALINA_HOME/webapps/kylin.war
-echo "Tomcat war deployed..."
-
-echo "Kylin is deployed successfully!!!"
-echo ""
-echo ""
-echo "Please check the configuration:"
-echo ""
-echo "==================================================================="
-cat /etc/kylin/kylin.properties
-echo "==================================================================="
-echo ""
-echo "You can directly modify it by editing /etc/kylin/kylin.properties"
-echo "If you're using standard hadoop sandbox, you might keep it untouched"
-echo "After checking, please start kylin by using \"./kylin.sh start\""
-


Mime
View raw message