forked from D-Net/dnet-hadoop
- Update the code which acquires the "IMPALA_HDFS_NODE", to test the "tmp"-dir, instead of the base-dir and introduce retries, to overcome potential file-system failures. This change was suggested by "Sebastian Tymkow" and "Grzegorz Bakalarski".
- Fix typos.
This commit is contained in:
parent
df6e3bda04
commit
b7c8acc563
|
@ -9,15 +9,27 @@ fi
|
|||
export HADOOP_USER_NAME=$2
|
||||
|
||||
IMPALA_HDFS_NODE=''
|
||||
if hdfs dfs -test -e hdfs://impala-cluster-mn1.openaire.eu >/dev/null 2>&1; then
|
||||
COUNTER=0
|
||||
|
||||
while [ $COUNTER -lt 3 ]; do
|
||||
if hdfs dfs -test -e hdfs://impala-cluster-mn1.openaire.eu/tmp >/dev/null 2>&1; then
|
||||
IMPALA_HDFS_NODE='hdfs://impala-cluster-mn1.openaire.eu:8020'
|
||||
elif hdfs dfs -test -e hdfs://impala-cluster-mn2.openaire.eu >/dev/null 2>&1; then
|
||||
break
|
||||
elif hdfs dfs -test -e hdfs://impala-cluster-mn2.openaire.eu/tmp >/dev/null 2>&1; then
|
||||
IMPALA_HDFS_NODE='hdfs://impala-cluster-mn2.openaire.eu:8020'
|
||||
break
|
||||
else
|
||||
echo -e "\n\nPROBLEM WHEN SETTING THE HDFS-NODE FOR IMPALA CLUSTER!\n\n"
|
||||
IMPALA_HDFS_NODE=''
|
||||
sleep 1
|
||||
fi
|
||||
((COUNTER++))
|
||||
done
|
||||
|
||||
if [ -z "$IMPALA_HDFS_NODE" ]; then
|
||||
echo -e "\n\nPROBLEM WHEN SETTING THE HDFS-NODE FOR IMPALA CLUSTER! $COUNTER\n\n"
|
||||
exit 1
|
||||
fi
|
||||
echo "Active IMPALA HDFS Node: ${IMPALA_HDFS_NODE}"
|
||||
echo "Active IMPALA HDFS Node: ${IMPALA_HDFS_NODE} , after ${COUNTER} retries."
|
||||
|
||||
|
||||
function copydb() {
|
||||
|
|
|
@ -9,15 +9,28 @@ fi
|
|||
export HADOOP_USER_NAME=$2
|
||||
|
||||
IMPALA_HDFS_NODE=''
|
||||
if hdfs dfs -test -e hdfs://impala-cluster-mn1.openaire.eu >/dev/null 2>&1; then
|
||||
COUNTER=0
|
||||
|
||||
while [ $COUNTER -lt 3 ]; do
|
||||
if hdfs dfs -test -e hdfs://impala-cluster-mn1.openaire.eu/tmp >/dev/null 2>&1; then
|
||||
IMPALA_HDFS_NODE='hdfs://impala-cluster-mn1.openaire.eu:8020'
|
||||
elif hdfs dfs -test -e hdfs://impala-cluster-mn2.openaire.eu >/dev/null 2>&1; then
|
||||
break
|
||||
elif hdfs dfs -test -e hdfs://impala-cluster-mn2.openaire.eu/tmp >/dev/null 2>&1; then
|
||||
IMPALA_HDFS_NODE='hdfs://impala-cluster-mn2.openaire.eu:8020'
|
||||
break
|
||||
else
|
||||
echo -e "\n\nPROBLEM WHEN SETTING THE HDFS-NODE FOR IMPALA CLUSTER!\n\n"
|
||||
IMPALA_HDFS_NODE=''
|
||||
sleep 1
|
||||
fi
|
||||
((COUNTER++))
|
||||
done
|
||||
|
||||
if [ -z "$IMPALA_HDFS_NODE" ]; then
|
||||
echo -e "\n\nPROBLEM WHEN SETTING THE HDFS-NODE FOR IMPALA CLUSTER! $COUNTER\n\n"
|
||||
exit 1
|
||||
fi
|
||||
echo "Active IMPALA HDFS Node: ${IMPALA_HDFS_NODE}"
|
||||
echo "Active IMPALA HDFS Node: ${IMPALA_HDFS_NODE} , after ${COUNTER} retries."
|
||||
|
||||
|
||||
function copydb() {
|
||||
|
||||
|
|
|
@ -9,15 +9,28 @@ fi
|
|||
#export HADOOP_USER_NAME=$2
|
||||
|
||||
IMPALA_HDFS_NODE=''
|
||||
if hdfs dfs -test -e hdfs://impala-cluster-mn1.openaire.eu >/dev/null 2>&1; then
|
||||
COUNTER=0
|
||||
|
||||
while [ $COUNTER -lt 3 ]; do
|
||||
if hdfs dfs -test -e hdfs://impala-cluster-mn1.openaire.eu/tmp >/dev/null 2>&1; then
|
||||
IMPALA_HDFS_NODE='hdfs://impala-cluster-mn1.openaire.eu:8020'
|
||||
elif hdfs dfs -test -e hdfs://impala-cluster-mn2.openaire.eu >/dev/null 2>&1; then
|
||||
break
|
||||
elif hdfs dfs -test -e hdfs://impala-cluster-mn2.openaire.eu/tmp >/dev/null 2>&1; then
|
||||
IMPALA_HDFS_NODE='hdfs://impala-cluster-mn2.openaire.eu:8020'
|
||||
break
|
||||
else
|
||||
echo -e "\n\nPROBLEM WHEN SETTING THE HDFS-NODE FOR IMPALA CLUSTER!\n\n"
|
||||
IMPALA_HDFS_NODE=''
|
||||
sleep 1
|
||||
fi
|
||||
((COUNTER++))
|
||||
done
|
||||
|
||||
if [ -z "$IMPALA_HDFS_NODE" ]; then
|
||||
echo -e "\n\nPROBLEM WHEN SETTING THE HDFS-NODE FOR IMPALA CLUSTER! $COUNTER\n\n"
|
||||
exit 1
|
||||
fi
|
||||
echo "Active IMPALA HDFS Node: ${IMPALA_HDFS_NODE}"
|
||||
echo "Active IMPALA HDFS Node: ${IMPALA_HDFS_NODE} , after ${COUNTER} retries."
|
||||
|
||||
|
||||
function copydb() {
|
||||
|
||||
|
|
|
@ -7,15 +7,28 @@ then
|
|||
fi
|
||||
|
||||
IMPALA_HDFS_NODE=''
|
||||
if hdfs dfs -test -e hdfs://impala-cluster-mn1.openaire.eu >/dev/null 2>&1; then
|
||||
COUNTER=0
|
||||
|
||||
while [ $COUNTER -lt 3 ]; do
|
||||
if hdfs dfs -test -e hdfs://impala-cluster-mn1.openaire.eu/tmp >/dev/null 2>&1; then
|
||||
IMPALA_HDFS_NODE='hdfs://impala-cluster-mn1.openaire.eu:8020'
|
||||
elif hdfs dfs -test -e hdfs://impala-cluster-mn2.openaire.eu >/dev/null 2>&1; then
|
||||
break
|
||||
elif hdfs dfs -test -e hdfs://impala-cluster-mn2.openaire.eu/tmp >/dev/null 2>&1; then
|
||||
IMPALA_HDFS_NODE='hdfs://impala-cluster-mn2.openaire.eu:8020'
|
||||
break
|
||||
else
|
||||
echo -e "\n\nPROBLEM WHEN SETTING THE HDFS-NODE FOR IMPALA CLUSTER!\n\n"
|
||||
IMPALA_HDFS_NODE=''
|
||||
sleep 1
|
||||
fi
|
||||
((COUNTER++))
|
||||
done
|
||||
|
||||
if [ -z "$IMPALA_HDFS_NODE" ]; then
|
||||
echo -e "\n\nPROBLEM WHEN SETTING THE HDFS-NODE FOR IMPALA CLUSTER! $COUNTER\n\n"
|
||||
exit 1
|
||||
fi
|
||||
echo "Active IMPALA HDFS Node: ${IMPALA_HDFS_NODE}"
|
||||
echo "Active IMPALA HDFS Node: ${IMPALA_HDFS_NODE} , after ${COUNTER} retries."
|
||||
|
||||
|
||||
export HADOOP_USER_NAME=$6
|
||||
export PROD_USAGE_STATS_DB="openaire_prod_usage_stats"
|
||||
|
|
|
@ -85,12 +85,12 @@ hive $HIVE_OPTS --database ${2}_funded -e "show tables" | grep -v WARN | sed "s/
|
|||
hive -f foo
|
||||
echo "Updated shadow monitor funded database"
|
||||
|
||||
echo "Updating shadow monitor insitutions database"
|
||||
echo "Updating shadow monitor institutions database"
|
||||
hive -e "drop database if exists ${SHADOW}_institutions cascade"
|
||||
hive -e "create database if not exists ${SHADOW}_institutions"
|
||||
hive $HIVE_OPTS --database ${2}_institutions -e "show tables" | grep -v WARN | sed "s/\(.*\)/create view ${SHADOW}_institutions.\1 as select * from ${2}_institutions.\1;/" > foo
|
||||
hive -f foo
|
||||
echo "Shadow db monitor insitutions ready!"
|
||||
echo "Shadow db monitor institutions ready!"
|
||||
|
||||
echo "Updating shadow monitor RIs database"
|
||||
for i in $contexts
|
||||
|
|
Loading…
Reference in New Issue