Review Board 1.7.22


SQOOP-796: Unable to use new Hadoop environment variables

Review Request #8685 - Created Dec. 19, 2012 and submitted

Sean Mackrory
trunk
SQOOP-796
Reviewers
Sqoop
sqoop-trunk
See JIRA for full description of the problem and solution.
Performed an import from MySQL on a pre-YARN MapReduce cluster (with HADOOP_HOME set) and a YARN cluster (with HADOOP_COMMON_HOME and HADOOP_MAPRED_HOME set). Although the YARN cluster failed, it appears to be after Sqoop has located all of it's dependencies and that the problem is with my YARN setup.
bin/configure-sqoop
Revision ee1dd7b New Change
[20] 37 lines
[+20]
38
  . "${SQOOP_CONF_DIR}/sqoop-env.sh"
38
  . "${SQOOP_CONF_DIR}/sqoop-env.sh"
39
fi
39
fi
40

    
   
40

   
41
# Find paths to our dependency systems. If they are unset, use CDH defaults.
41
# Find paths to our dependency systems. If they are unset, use CDH defaults.
42

    
   
42

   
43
if [ -z "${HADOOP_HOME}" ]; then
43
if [ -z "${HADOOP_COMMON_HOME}" ]; then
44
  HADOOP_HOME=/usr/lib/hadoop
44
  if [ -n "${HADOOP_HOME}" ]; then

    
   
45
    HADOOP_COMMON_HOME=${HADOOP_HOME}

    
   
46
  else

    
   
47
    HADOOP_COMMON_HOME=/usr/lib/hadoop

    
   
48
  fi

    
   
49
fi

    
   
50
if [ -z "${HADOOP_MAPRED_HOME}" ]; then

    
   
51
  if [ -n "${HADOOP_HOME}" ]; then

    
   
52
    HADOOP_MAPRED_HOME=${HADOOP_HOME}

    
   
53
  else

    
   
54
    HADOOP_MAPRED_HOME=/usr/lib/hadoop-mapreduce

    
   
55
  fi
45
fi
56
fi
46
if [ -z "${HBASE_HOME}" ]; then
57
if [ -z "${HBASE_HOME}" ]; then
47
  HBASE_HOME=/usr/lib/hbase
58
  HBASE_HOME=/usr/lib/hbase
48
fi
59
fi
49

    
   
60

   
50
# Check: If we can't find our dependencies, give up here.
61
# Check: If we can't find our dependencies, give up here.
51
if [ ! -d "${HADOOP_HOME}" ]; then
62
if [ ! -d "${HADOOP_COMMON_HOME}" ]; then
52
  echo "Error: $HADOOP_HOME does not exist!"
63
  echo "Error: $HADOOP_COMMON_HOME does not exist!"
53
  echo 'Please set $HADOOP_HOME to the root of your Hadoop installation.'
64
  echo 'Please set $HADOOP_COMMON_HOME to the root of your Hadoop installation.'

    
   
65
  exit 1

    
   
66
fi

    
   
67
if [ ! -d "${HADOOP_MAPRED_HOME}" ]; then

    
   
68
  echo "Error: $HADOOP_MAPRED_HOME does not exist!"

    
   
69
  echo 'Please set $HADOOP_MAPRED_HOME to the root of your Hadoop MapReduce installation.'
54
  exit 1
70
  exit 1
55
fi
71
fi
56

    
   
72

   
57
## Moved to be a runtime check in sqoop.
73
## Moved to be a runtime check in sqoop.
58
if [ ! -d "${HBASE_HOME}" ]; then
74
if [ ! -d "${HBASE_HOME}" ]; then
[+20] [20] 56 lines
[+20]
115

    
   
131

   
116
export SQOOP_CLASSPATH
132
export SQOOP_CLASSPATH
117
export SQOOP_CONF_DIR
133
export SQOOP_CONF_DIR
118
export SQOOP_JAR_DIR
134
export SQOOP_JAR_DIR
119
export HADOOP_CLASSPATH
135
export HADOOP_CLASSPATH
120
export HADOOP_HOME
136
export HADOOP_COMMON_HOME

    
   
137
export HADOOP_MAPRED_HOME
121
export HBASE_HOME
138
export HBASE_HOME
122

    
   
139

   
bin/sqoop
Revision bc69083 New Change
 
conf/sqoop-env-template.sh
Revision 0294f17 New Change
 
src/docs/man/common-args.txt
Revision 129f5d1 New Change
 
src/docs/man/sqoop.txt
Revision 44b4f4e New Change
 
src/docs/user/common-args.txt
Revision 7c69886 New Change
 
src/docs/user/help.txt
Revision 11b4f0c New Change
 
src/docs/user/tools.txt
Revision ce83a24 New Change
 
src/java/org/apache/sqoop/SqoopOptions.java
Revision 3e0ec3e New Change
 
src/java/org/apache/sqoop/orm/CompilationManager.java
Revision 26adcbf New Change
 
src/java/org/apache/sqoop/tool/BaseSqoopTool.java
Revision c0221c9 New Change
 
src/scripts/run-perftest.sh
Revision 2a4ba21 New Change
 
  1. bin/configure-sqoop: Loading...
  2. bin/sqoop: Loading...
  3. conf/sqoop-env-template.sh: Loading...
  4. src/docs/man/common-args.txt: Loading...
  5. src/docs/man/sqoop.txt: Loading...
  6. src/docs/user/common-args.txt: Loading...
  7. src/docs/user/help.txt: Loading...
  8. src/docs/user/tools.txt: Loading...
  9. src/java/org/apache/sqoop/SqoopOptions.java: Loading...
  10. src/java/org/apache/sqoop/orm/CompilationManager.java: Loading...
  11. src/java/org/apache/sqoop/tool/BaseSqoopTool.java: Loading...
  12. src/scripts/run-perftest.sh: Loading...