kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [09/50] incubator-kylin git commit: better deployment
Date Tue, 03 Mar 2015 10:28:23 GMT
better deployment


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

Branch: refs/heads/master
Commit: 28fe5c292fce8bbba96fa4eabd0a16f3d7563133
Parents: ed729ee
Author: Li, Yang <yangli9@ebay.com>
Authored: Fri Feb 13 09:03:21 2015 +0800
Committer: Li, Yang <yangli9@ebay.com>
Committed: Fri Feb 13 09:03:21 2015 +0800

----------------------------------------------------------------------
 bin/check-env.sh            | 21 ++++-----------------
 bin/find-hive-dependency.sh |  8 +++++++-
 bin/start-kylin.sh          |  3 +--
 bin/stop-kylin.sh           |  3 +++
 script/compress.sh          |  3 +++
 5 files changed, 18 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/28fe5c29/bin/check-env.sh
----------------------------------------------------------------------
diff --git a/bin/check-env.sh b/bin/check-env.sh
index 3bef6c4..3e9a814 100644
--- a/bin/check-env.sh
+++ b/bin/check-env.sh
@@ -1,39 +1,26 @@
-#!/bin/sh
+#by source
 
-echo "Checking KYLIN_HOME..."
 if [ -z "$KYLIN_HOME" ]
 then
-    echo 'please make sure KYLIN_HOME has been set'
-    exit 1
-else
-    echo "KYLIN_HOME is set to ${KYLIN_HOME}"
+	bin=$(dirname ${0})
+	export KYLIN_HOME=$(dirname $bin)
 fi
+echo "KYLIN_HOME is set to ${KYLIN_HOME}"
 
-echo "Checking hbase..."
 if [ -z "$(command -v hbase version)" ]
 then
     echo "Please make sure the user has the privilege to run hbase shell"
     exit 1
-else
-    echo "hbase check passed"
 fi
 
-echo "Checking hive..."
 if [ -z "$(command -v hive --version)" ]
 then
     echo "Please make sure the user has the privilege to run hive shell"
     exit 1
-else
-    echo "hive check passed"
 fi
 
-echo "Checking hadoop..."
 if [ -z "$(command -v hadoop version)" ]
 then
     echo "Please make sure the user has the privilege to run hadoop shell"
     exit 1
-else
-    echo "hadoop check passed"
 fi
-
-exit 0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/28fe5c29/bin/find-hive-dependency.sh
----------------------------------------------------------------------
diff --git a/bin/find-hive-dependency.sh b/bin/find-hive-dependency.sh
index 7bd5f43..bc9b00c 100644
--- a/bin/find-hive-dependency.sh
+++ b/bin/find-hive-dependency.sh
@@ -4,6 +4,7 @@ hive_env=`hive -e set | grep 'env:CLASSPATH'`
 
 hive_classpath=`echo $hive_env | grep 'env:CLASSPATH' | awk -F '=' '{print $2}'`
 arr=(`echo $hive_classpath | cut -d ":"  --output-delimiter=" " -f 1-`)
+hive_conf_path=
 hive_exec_path=
 for data in ${arr[@]}
 do
@@ -12,9 +13,14 @@ do
     then
         hive_exec_path=$data
     fi
+    result=`echo $data | grep 'hive/conf'`
+    if [ $result ]
+    then
+        hive_conf_path=$data
+    fi
 done
 hdp_home=`echo $hive_exec_path | awk -F '/hive/lib/' '{print $1}'`
 
-hive_dependency=/usr/hdp/current/hive-client/conf/:${hdp_home}/hive/lib/*:${hdp_home}/hive-hcatalog/share/hcatalog/*
+hive_dependency=$hive_conf_path:${hdp_home}/hive/lib/*:${hdp_home}/hive-hcatalog/share/hcatalog/*
 echo "hive dependency: $hive_dependency"
 export hive_dependency
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/28fe5c29/bin/start-kylin.sh
----------------------------------------------------------------------
diff --git a/bin/start-kylin.sh b/bin/start-kylin.sh
index b2544a5..70cbb62 100644
--- a/bin/start-kylin.sh
+++ b/bin/start-kylin.sh
@@ -1,12 +1,11 @@
 #!/bin/sh
 
 dir=$(dirname ${0})
+source ${dir}/check-env.sh
 
 tomcat_root=${dir}/../tomcat
 export tomcat_root
 
-sh ${dir}/check-env.sh || { exit 1; }
-
 #if [ ! -z "$KYLIN_LD_LIBRARY_PATH" ]
 #then
 #    echo "KYLIN_LD_LIBRARY_PATH is set to $KYLIN_LD_LIBRARY_PATH"

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/28fe5c29/bin/stop-kylin.sh
----------------------------------------------------------------------
diff --git a/bin/stop-kylin.sh b/bin/stop-kylin.sh
index c7a61b2..dad0a83 100644
--- a/bin/stop-kylin.sh
+++ b/bin/stop-kylin.sh
@@ -1,5 +1,8 @@
 #!/bin/sh
 
+dir=$(dirname ${0})
+source ${dir}/check-env.sh
+
 if [ ! -f "${KYLIN_HOME}/pid" ]
 then
     echo "no pid found"

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/28fe5c29/script/compress.sh
----------------------------------------------------------------------
diff --git a/script/compress.sh b/script/compress.sh
index 4dd91f3..f7d860a 100644
--- a/script/compress.sh
+++ b/script/compress.sh
@@ -16,6 +16,9 @@ echo 'package tgz'
 rm -rf kylin-${version}
 mkdir kylin-${version}
 cp -r lib bin conf tomcat kylin-${version}
+find kylin-${version} -type d -exec chmod 755 {} \;
+find kylin-${version} -type f -exec chmod 644 {} \;
+find kylin-${version} -type f -name "*.sh" -exec chmod 755 {} \;
 tar -cvzf kylin-${version}.tgz kylin-${version}
 rm -rf kylin-${version}
 


Mime
View raw message