sqoop 数据从 oracle 到 hive 错误
Posted
技术标签:
【中文标题】sqoop 数据从 oracle 到 hive 错误【英文标题】:sqoop data from oracle to hive ERROR 【发布时间】:2015-05-29 15:42:46 【问题描述】:我正在尝试将数据从 oracle sqoop 到 HDFS。为此,我正在使用 sqoop。
我下载了ojdbc6.jar
并将其放入/usr/hdp/2.2.0.0-2041/sqoop/lib
路径并执行以下命令检查我是否能够连接到oracle数据库。
sqoop list-databases --connect jdbc:oracle:thin:@hostname:port/service --username XXXX --password XXXX --verbose;
我收到以下错误。
Warning: /usr/hdp/2.2.0.0-2041/accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
15/05/29 15:24:42 INFO sqoop.Sqoop: Running Sqoop version: 1.4.5.2.2.0.0-2041
15/05/29 15:24:42 DEBUG tool.BaseSqoopTool: Enabled debug logging.
15/05/29 15:24:42 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
15/05/29 15:24:43 DEBUG sqoop.ConnFactory: Loaded manager factory: org.apache.sqoop.manager.oracle.OraOopManagerFactory
15/05/29 15:24:43 DEBUG sqoop.ConnFactory: Loaded manager factory: com.cloudera.sqoop.manager.DefaultManagerFactory
15/05/29 15:24:43 DEBUG sqoop.ConnFactory: Trying ManagerFactory: org.apache.sqoop.manager.oracle.OraOopManagerFactory
15/05/29 15:24:44 DEBUG oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop can be called by Sqoop!
15/05/29 15:24:44 INFO oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop is disabled.
15/05/29 15:24:44 DEBUG sqoop.ConnFactory: Trying ManagerFactory: com.cloudera.sqoop.manager.DefaultManagerFactory
15/05/29 15:24:44 DEBUG manager.DefaultManagerFactory: Trying with scheme: jdbc:oracle:thin:@hostname
15/05/29 15:24:45 DEBUG manager.OracleManager$ConnCache: Instantiated new connection cache.
15/05/29 15:24:45 INFO manager.SqlManager: Using default fetchSize of 1000
15/05/29 15:24:45 DEBUG sqoop.ConnFactory: Instantiated ConnManager org.apache.sqoop.manager.OracleManager@2f37e8bc
15/05/29 15:24:46 DEBUG manager.OracleManager: Creating a new connection for jdbc:oracle:thin:@hostname:port/service, using username: username
15/05/29 15:24:46 DEBUG manager.OracleManager: No connection paramenters specified. Using regular API for making connection.
15/05/29 15:25:07 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.sqoop.manager.OracleManager.listDatabases(OracleManager.java:695)
at org.apache.sqoop.tool.ListDatabasesTool.run(ListDatabasesTool.java:49)
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
这个错误是因为授予权限吗?我不需要授予任何权限吗?或者这是连接错误?
【问题讨论】:
你可以试试这个***.com/questions/29418270/… 【参考方案1】:我解决了 sqoop 命令并找到了这个解决方案。它对我有用。 我从 cmd ping 了主机名,并找到了它正在 ping 的 IP 地址。 我在 sqooop 执行命令中用 ipaddress 替换了主机名,它正在工作。
【讨论】:
以上是关于sqoop 数据从 oracle 到 hive 错误的主要内容,如果未能解决你的问题,请参考以下文章
使用 sqoop 从 Oracle 获取数据到 hive 时出错