OJDBC驱动程序中的Cloudera QuickStart VM Sqoop错误

时间:2019-08-24 03:58:57

标签: sqoop cloudera

我安装了Cloudera QuickStart VM 5.13。我正在使用Sqoop。 我尝试执行下一条命令:

[cloudera@quickstart ~]$ sqoop list-tables --connect jdbc:oracle:thin:@localhost:1521:xe --username Guest1 --password G147

然后我出现错误:

Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
19/08/23 20:42:38 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.13.0
19/08/23 20:42:38 INFO oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop is disabled.
19/08/23 20:42:38 INFO manager.SqlManager: Using default fetchSize of 1000
19/08/23 20:42:39 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.NullPointerException
java.lang.NullPointerException
        at org.apache.sqoop.manager.OracleManager.listTables(OracleManager.java:769)
        at org.apache.sqoop.tool.ListTablesTool.run(ListTablesTool.java:49)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:252)

我认为Cloudera没有OJBDC驱动程序。

我该怎么办? 我必须在哪里安装Oracle OJDBC驱动程序? 叫什么名字?

研究

1。。我已将ojdbc6.jar放在下一个目录中:

sudo cp /home/cloudera/Downloads/ojdbc6.jar /var/lib/sqoop/ojdbc6.jar
sudo cp /home/cloudera/Downloads/ojdbc6.jar /var/lib/sqoop2/ojdbc6.jar
sudo cp /home/cloudera/Downloads/ojdbc6.jar /var/lib/oozie/ojdbc6.jar
sudo cp /home/cloudera/Downloads/ojdbc6.jar /usr/share/java/ojdbc6.jar
sudo cp /home/cloudera/Downloads/ojdbc6.jar /usr/share/java/ojdbc6.jar
sudo cp /home/cloudera/Downloads/ojdbc6.jar /usr/share/cmf/common_jars/ojdbc6.jar
sudo cp /home/cloudera/Downloads/ojdbc6.jar /usr/share/cmf/cloudera-scm-telepub/jars/ojdbc6.jar
sudo cp /home/cloudera/Downloads/ojdbc6.jar /usr/lib/sentry/lib/ojdbc6.jar
sudo cp /home/cloudera/Downloads/ojdbc6.jar /usr/lib/hive/lib/ojdbc6.jar
sudo cp /home/cloudera/Downloads/ojdbc6.jar /usr/share/java/ojdbc6.jar

这是同样的错误。

1 个答案:

答案 0 :(得分:0)

安装JDK 1.7(或需要安装)并设置系统变量( JAVA_HOME ORACLE_HOME ORACLE_SID )并复制jar(/ var /lib/sqoop/ojdbc6.jar)。 例如:

export JAVA_HOME=/usr/java/jdk1.7.0_80/
export ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE/
export ORACLE_SID=XE