You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by lu...@apache.org on 2015/07/21 10:05:31 UTC

[25/50] [abbrv] incubator-kylin git commit: KYLIN-868 add a metadata backup/restore script in bin folder

KYLIN-868 add a metadata backup/restore script in bin folder


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

Branch: refs/heads/master
Commit: cbcfd59df85ecd417583c4d4471acc7ed2f21071
Parents: 0975139
Author: honma <ho...@ebay.com>
Authored: Wed Jul 1 15:53:10 2015 +0800
Committer: honma <ho...@ebay.com>
Committed: Wed Jul 1 15:53:10 2015 +0800

----------------------------------------------------------------------
 bin/metastore.sh | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/cbcfd59d/bin/metastore.sh
----------------------------------------------------------------------
diff --git a/bin/metastore.sh b/bin/metastore.sh
new file mode 100644
index 0000000..f08de31
--- /dev/null
+++ b/bin/metastore.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+dir=$(dirname ${0})
+source ${dir}/check-env.sh
+
+_jobjar=`ls ${KYLIN_HOME}/lib |grep kylin-job`
+_fulljobjar="${KYLIN_HOME}/lib/${_jobjar}"
+
+if [ $1 == "backup" ]
+then
+
+    mkdir -p ${KYLIN_HOME}/meta_backups
+
+    _now=$(date +"%Y_%m_%d_%H_%M_%S")
+    _file="${KYLIN_HOME}/meta_backups/meta_${_now}"
+    echo "Starting backup to ${_file}"
+    mkdir -p ${_file}
+
+    hbase  org.apache.hadoop.util.RunJar ${_fulljobjar}   org.apache.kylin.common.persistence.ResourceTool  copy ${KYLIN_HOME}/conf/kylin.properties ${_file}
+    echo "metadata store backed up to ${_file}"
+
+elif [ $1 == "restore" ]
+then
+
+    _file=$2
+    echo "Starting restoring $_file"
+    hbase  org.apache.hadoop.util.RunJar  ${_fulljobjar}   org.apache.kylin.common.persistence.ResourceTool  copy $_file ${KYLIN_HOME}/conf/kylin.properties
+
+elif [ $1 == "reset" ]
+then
+
+    hbase  org.apache.hadoop.util.RunJar ${_fulljobjar}   org.apache.kylin.common.persistence.ResourceTool  reset
+
+else
+    echo "usage: metastore.sh backup or metastore.sh restore PATH_TO_LOCAL_META"
+    exit 1
+fi