Could not find or load main class org.apache.sqoop.Sqoop (sqoop 1.4.7 & hadoop 2.7.7)

1. sqoop 下载 : http://mirrors.hust.edu.cn/apache/sqoop/1.4.7/sqoop-1.4.7.bin__hadoop-2.6.0.tar.gz  (一定一定要选择 bin__hadoop 版本,否则也可能报错 java.lang.NoClassDefFoundError: org/apache/avro/LogicalType )

2.  配置 sqoop-env.sh 如下:

export HADOOP_COMMON_HOME="/home/work/soft/hadoop/"

export HADOOP_MAPRED_HOME="/home/work/soft/hadoop/"


export ZOOCFGDIR="/home/work/zookeeper/"  # 如果安装了 zookeeper 的话, 非必须

3. 配置 .bashrc

   

export SQOOP_HOME="/home/work/soft/sqoop-1.4.7.bin__hadoop-2.6.0"
   export PATH="${PATH}:${SQOOP_HOME}/bin/"

   执行 source ~/.bashrc

4.  部署mysql驱动包

    https://dev.mysql.com/downloads/connector/j/8.0.html  (下载地址)

   下载回来的文件是 mysql-connector-java-8.0.13.tar.gz ,解压之后。拷贝 mysql-connector-java-8.0.13.jar 到 ${SQOOP_HOME}/lib/ 目录,即

   

cp mysql-connector-java-8.0.13.jar ${SQOOP_HOME}/lib/

 

你可能感兴趣的:(sqoop,hadoop)