1.海豚执行如下shell脚本
${SQOOP_HOME}/bin/sqoop version
报错信息:
Error: Could not find or load main class org.apache.sqoop.Sqoop
2.我在命令行 /opt/cloudera/parcels/CDH/lib/sqoop/bin 目录下执行报错找不到JAVA_HOME
./sqoop version
3.我在命令行 /opt/cloudera/parcels/CDH/bin 目录下执行可以正常执行
./sqoop version
4.于是修改了/opt/cloudera/parcels/CDH/etc/sqoop/conf.dist 与 /opt/cloudera/parcels/CDH/lib/sqoop/conf 目录下的sqoop_env.sh 文件 添加如下配置
export HADOOP_COMMON_HOME=/opt/cloudera/parcels/CDH/lib/hadoop
export HADOOP_MAPRED_HOME=/opt/cloudera/parcels/CDH/lib/hadoop-mapreduce
export HIVE_HOME=/opt/cloudera/parcels/CDH/lib/hive
export ZOOKEEPER_HOME=/opt/cloudera/parcels/CDH/lib/zookeeper
export ZOOCFGDIR=/opt/cloudera/parcels/CDH/lib/zookeeper/conf
export JAVA_HOME=/usr/local/jdk1.8.0_152
5.而后步骤2可以正常执行
然后修改海豚的dolphinscheduler_env.sh 的文件
export HADOOP_HOME=/opt/cloudera/parcels/CDH/lib/hadoop
export HADOOP_CONF_DIR=/etc/hadoop/conf
export SQOOP_HOME=/opt/cloudera/parcels/CDH/lib/sqoop
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH::
export HADOOP_COMMON_HOME=/opt/cloudera/parcels/CDH/lib/hadoop
export HADOOP_MAPRED_HOME=/opt/cloudera/parcels/CDH/lib/hadoop-mapreduce
export HIVE_HOME=/opt/cloudera/parcels/CDH/lib/hive
export ZOOKEEPER_HOME=/opt/cloudera/parcels/CDH/lib/zookeeper
export ZOOCFGDIR=/opt/cloudera/parcels/CDH/lib/zookeeper/conf
export JAVA_HOME=/usr/local/jdk1.8.0_152
6.海豚就可以正常使用到sqoop命令了