sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Qiang Zhang <zhangqia...@zte.com.cn>
Subject Review Request 55401: There are two questions in the sqoop_server_classpath_set function of the sqoop.sh
Date Wed, 11 Jan 2017 02:59:03 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55401/
-----------------------------------------------------------

Review request for Sqoop.


Bugs: SQOOP-3102
    https://issues.apache.org/jira/browse/SQOOP-3102


Repository: sqoop-sqoop2


Description
-------

$HADOOP_YARN_HOME and $HADOOP_HDFS_HOME were used as following in start-all.sh of the hadoop:
# start hdfs daemons if hdfs is present
if [ -f "${HADOOP_HDFS_HOME}"/sbin/start-dfs.sh ]; then
  "${HADOOP_HDFS_HOME}"/sbin/start-dfs.sh --config $HADOOP_CONF_DIR
fi
# start yarn daemons if yarn is present
if [ -f "${HADOOP_YARN_HOME}"/sbin/start-yarn.sh ]; then
  "${HADOOP_YARN_HOME}"/sbin/start-yarn.sh --config $HADOOP_CONF_DIR
fi
Based on above logic the $HADOOP_YARN_HOME and $HADOOP_HDFS_HOME must equal to $HADOOP_HOME.
And they must be set as environment variable.

In sqoop2 they were used as following in sqoop_server_classpath_set function for sqoop.sh
file.
HADOOP_COMMON_HOME=${HADOOP_COMMON_HOME:-${HADOOP_HOME}/share/hadoop/common}
HADOOP_HDFS_HOME=${HADOOP_HDFS_HOME:-${HADOOP_HOME}/share/hadoop/hdfs}
HADOOP_MAPRED_HOME=${HADOOP_MAPRED_HOME:-${HADOOP_HOME}/share/hadoop/mapreduce}
HADOOP_YARN_HOME=${HADOOP_YARN_HOME:-${HADOOP_HOME}/share/hadoop/yarn}
In above logic the HADOOP_HDFS_HOME will equal to HADOOP_HOME when HADOOP_HDFS_HOME equal
to $HADOOP_HOME in environment variable . The HADOOP_YARN_HOME will equal to HADOOP_HOME when
HADOOP_YARN_HOME was set to $HADOOP_HOME in environment variable also.
As a result, sqoop2 start failure.
We shouldn't only check whether HADOOP_HDFS_HOME is empty, but also directly set HADOOP_HDFS_HOME=${HADOOP_HOME}/share/hadoop/hdfs
and HADOOP_YARN_HOME={HADOOP_HOME}/share/hadoop/yarn in sqoop_server_classpath_set function
for sqoop.sh file.


Diffs
-----

  dist/src/main/bin/sqoop.sh 3b2c6e1 

Diff: https://reviews.apache.org/r/55401/diff/


Testing
-------


Thanks,

Qiang Zhang


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message