aboutsummaryrefslogtreecommitdiffstats
path: root/cdap3vm/config/services-setup-templates/namenode-setup.sh
diff options
context:
space:
mode:
authorlj1412 <lji@research.att.com>2017-02-14 15:10:55 +0000
committerlj1412 <lji@research.att.com>2017-02-14 15:10:57 +0000
commit39fd75bdb79ac63a05dadda0ba32792e49783031 (patch)
treed63bf1c88c1596031cdcb38c81c6fd12f17d831d /cdap3vm/config/services-setup-templates/namenode-setup.sh
parent58c3d798750a223440a944661e5dec5e33c0c0e1 (diff)
Init dcae.apod.cdap
Change-Id: I0d1f1ba04f8ba7a2a276e4e382eb07ae9d6a7652 Signed-off-by: lj1412 <lji@research.att.com>
Diffstat (limited to 'cdap3vm/config/services-setup-templates/namenode-setup.sh')
-rw-r--r--cdap3vm/config/services-setup-templates/namenode-setup.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/cdap3vm/config/services-setup-templates/namenode-setup.sh b/cdap3vm/config/services-setup-templates/namenode-setup.sh
new file mode 100644
index 0000000..5ba1297
--- /dev/null
+++ b/cdap3vm/config/services-setup-templates/namenode-setup.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+__HDP_HADOOP_BIN__/hdfs namenode -format -force
+__HDP_HADOOP_SBIN__/hadoop-daemon.sh --config __HADOOP_CONF_DIR__ start namenode
+__HDP_HADOOP_SBIN__/hadoop-daemon.sh --config __HADOOP_CONF_DIR__ start datanode
+
+# Create HBASE related folders here
+(
+hdfs dfs -mkdir -p /apps/hbase/staging /apps/hbase/data
+
+hdfs dfs -chown hbase:hdfs /apps/hbase/staging /apps/hbase/data
+hdfs dfs -chmod 711 /apps/hbase/staging
+hdfs dfs -chmod 755 /apps/hbase/data
+
+hdfs dfs -chown hdfs:hdfs /apps/hbase
+) &
+
+hdfs dfs -mkdir -p /hdp/apps/__HDP_VERSION__/mapreduce/
+hdfs dfs -put __HDP_CURRENT_FOLDER__/hadoop-client/mapreduce.tar.gz /hdp/apps/__HDP_VERSION__/mapreduce/
+hdfs dfs -chown -R __HDFS_USER__:__HADOOP_GROUP__ /hdp
+hdfs dfs -chmod -R 555 /hdp/apps/__HDP_VERSION__/mapreduce
+hdfs dfs -chmod 444 /hdp/apps/__HDP_VERSION__/mapreduce/mapreduce.tar.gz
+
+# We will try to set up general CDAP related stuff (cluster-prep) here
+(
+hdfs dfs -mkdir -p /user/yarn
+hdfs dfs -chown yarn:yarn /user/yarn
+
+hdfs dfs -mkdir -p /cdap
+hdfs dfs -chown yarn /cdap
+
+hdfs dfs -mkdir -p /cdap/tx.snapshot
+hdfs dfs -chown yarn /cdap/tx.snapshot
+) &