forked from Gradiant/bigdata-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
38 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,44 @@ | ||
#!/bin/bash | ||
|
||
: ${HADOOP_PREFIX:=/usr/local/hadoop} | ||
#: ${HADOOP_PREFIX:=/usr/local/hadoop} | ||
|
||
. $HADOOP_PREFIX/etc/hadoop/hadoop-env.sh | ||
#. $HADOOP_PREFIX/etc/hadoop/hadoop-env.sh | ||
|
||
# Directory to find config artifacts | ||
CONFIG_DIR="/tmp/hadoop-config" | ||
#CONFIG_DIR="/tmp/hadoop-config" | ||
|
||
set -x | ||
|
||
# Copy config files from volume mount | ||
for f in slaves core-site.xml hdfs-site.xml mapred-site.xml yarn-site.xml; do | ||
if [[ -e ${CONFIG_DIR}/$f ]]; then | ||
cp ${CONFIG_DIR}/$f $HADOOP_HOME/etc/hadoop/$f | ||
else | ||
echo "ERROR: Could not find $f in $CONFIG_DIR" | ||
exit 1 | ||
fi | ||
done | ||
#for f in slaves core-site.xml hdfs-site.xml mapred-site.xml yarn-site.xml; do | ||
# if [[ -e ${CONFIG_DIR}/$f ]]; then | ||
# cp ${CONFIG_DIR}/$f $HADOOP_HOME/etc/hadoop/$f | ||
# else | ||
# echo "ERROR: Could not find $f in $CONFIG_DIR" | ||
# exit 1 | ||
# fi | ||
|
||
# Note. This script set hive paths in hdfs with user hive and ensures hiveServer is runAsUser hive | ||
|
||
HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -mkdir /tmp | ||
HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -mkdir -p /user/hive/warehouse | ||
HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -chmod g+w /tmp | ||
HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -chmod g+w /user/hive/warehouse | ||
HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -chown hive:hive /tmp | ||
HADOOP_USER_NAME={{ .Values.conf.hdfsAdminUser }} hdfs dfs -chown hive:hive /user/hive/warehouse | ||
|
||
|
||
if id -u hive ; then | ||
echo "hive user exists"; | ||
else | ||
echo "Creating hive user"; | ||
groupadd -g 500 -r hive && \ | ||
useradd --comment "Hive user" -u 500 --shell /bin/bash -M -r -g hive hive | ||
fi | ||
#if id -u hive ; then | ||
# echo "hive user exists"; | ||
#else | ||
# echo "Creating hive user"; | ||
# groupadd -g 500 -r hive && \ | ||
# useradd --comment "Hive user" -u 500 --shell /bin/bash -M -r -g hive hive | ||
#fi | ||
|
||
if [[ whoami != hive ]] | ||
then | ||
echo "Switching to hive user"; | ||
su hive -c "cd $HIVE_HOME/bin; ./hiveserver2 --hiveconf hive.server2.enable.doAs=false" | ||
else | ||
#if [[ whoami != hive ]] | ||
#then | ||
# echo "Switching to hive user"; | ||
# su hive -c "cd $HIVE_HOME/bin; ./hiveserver2 --hiveconf hive.server2.enable.doAs=false" | ||
#else | ||
cd $HIVE_HOME/bin; ./hiveserver2 --hiveconf hive.server2.enable.doAs=false | ||
fi | ||
#fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters