11#! /bin/bash
22
3- : ${HADOOP_PREFIX:=/ usr/ local/ hadoop}
3+ # : ${HADOOP_PREFIX:=/usr/local/hadoop}
44
5- . $HADOOP_PREFIX /etc/hadoop/hadoop-env.sh
5+ # . $HADOOP_PREFIX/etc/hadoop/hadoop-env.sh
66
77# Directory to find config artifacts
8- CONFIG_DIR=" /tmp/hadoop-config"
8+ # CONFIG_DIR="/tmp/hadoop-config"
99
1010set -x
1111
1212# Copy config files from volume mount
13- for f in slaves core-site.xml hdfs-site.xml mapred-site.xml yarn-site.xml; do
14- if [[ -e ${CONFIG_DIR} /$f ]]; then
15- cp ${CONFIG_DIR} /$f $HADOOP_HOME /etc/hadoop/$f
16- else
17- echo " ERROR: Could not find $f in $CONFIG_DIR "
18- exit 1
19- fi
20- done
13+ # for f in slaves core-site.xml hdfs-site.xml mapred-site.xml yarn-site.xml; do
14+ # if [[ -e ${CONFIG_DIR}/$f ]]; then
15+ # cp ${CONFIG_DIR}/$f $HADOOP_HOME/etc/hadoop/$f
16+ # else
17+ # echo "ERROR: Could not find $f in $CONFIG_DIR"
18+ # exit 1
19+ # fi
2120
2221# Note. This script set hive paths in hdfs with user hive and ensures hiveServer is runAsUser hive
2322
2423HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -mkdir /tmp
2524HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -mkdir -p /user/hive/warehouse
2625HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -chmod g+w /tmp
2726HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -chmod g+w /user/hive/warehouse
28- HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -chown hive:hive /tmp
2927HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -chown hive:hive /user/hive/warehouse
3028
3129
32- if id -u hive ; then
33- echo " hive user exists" ;
34- else
35- echo " Creating hive user" ;
36- groupadd -g 500 -r hive && \
37- useradd --comment " Hive user" -u 500 --shell /bin/bash -M -r -g hive hive
38- fi
30+ # if id -u hive ; then
31+ # echo "hive user exists";
32+ # else
33+ # echo "Creating hive user";
34+ # groupadd -g 500 -r hive && \
35+ # useradd --comment "Hive user" -u 500 --shell /bin/bash -M -r -g hive hive
36+ # fi
3937
40- if [[ whoami != hive ]]
41- then
42- echo " Switching to hive user" ;
43- su hive -c " cd $HIVE_HOME /bin; ./hiveserver2 --hiveconf hive.server2.enable.doAs=false"
44- else
38+ # if [[ whoami != hive ]]
39+ # then
40+ # echo "Switching to hive user";
41+ # su hive -c "cd $HIVE_HOME/bin; ./hiveserver2 --hiveconf hive.server2.enable.doAs=false"
42+ # else
4543 cd $HIVE_HOME /bin; ./hiveserver2 --hiveconf hive.server2.enable.doAs=false
46- fi
44+ # fi
0 commit comments