我在本地机器上安装了Sqoop.以下是配置信息.
Bash.bashrc:
export HADOOP_HOME=/home/hduser/hadoop
export HBASE_HOME=/home/hduser/hbase
export HIVE_HOME=/home/hduser/hive
export HCAT_HOME=/home/hduser/hive/hcatalog
export SQOOP_HOME=/home/hduser/sqoop
export PATH=$PATH:$HIVE_HOME/bin
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HBASE_HOME/bin
export PATH=$PATH:$SQOOP_HOME/bin
export PATH=$PATH:$HCAT_HOME/bin
Hadoop的:
Version: Hadoop 1.0.3
蜂巢:
Version: hive 0.11.0
Mysql连接器驱动程序
version: mysql-connector-java-5.1.29
"The driver is copied to the lib folder of sqoop"
Sqoop:
version: sqoop 1.4.4
完成所有安装后,我在mysql中创建了一个名为practice_1的表,但是当我运行load命令将数据从mysql加载到hdfs时,该命令会引发异常:
ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver
Coud有人请指导我可能出现的问题.
解决方法:
在’SQOOP’类路径检查this中需要数据库驱动程序
关于’SQOOP’的精彩解释
SQOOP还有其他选择
Ex: –driver com.microsoft.jdbc.sqlserver.SQLServerDriver -libjars=”.*jar”
从here开始
You can use Sqoop with any other JDBC-compliant database. First, download the appropriate JDBC driver for the type of database you want to import, and install the .jar file in the $SQOOP_HOME/lib directory on your client machine. (This will be /usr/lib/sqoop/lib if you installed from an RPM or Debian package.) Each driver .jar file also has a specific driver class which defines the entry-point to the driver. For example, MySQL’s Connector/J library has a driver class of com.mysql.jdbc.Driver. Refer to your database vendor-specific documentation to determine the main driver class. This class must be provided as an argument to Sqoop with –driver.
您可能有兴趣了解连接器和驱动程序之间的区别here是文章