sqoop 数据从 oracle 到 hive ERROR
sqoop data from oracle to hive ERROR
我正在尝试将数据从 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)
这个错误是因为授予权限吗?我需要授予任何权限吗?或者这是一个连接错误?
我解决了 sqoop 命令并找到了这个解决方案。它对我有用。
我从 cmd ping 了主机名,发现了它正在 ping 到的 IP 地址。
我在 sqooop 执行命令中用 ipaddress 替换了主机名,它正在工作。
我正在尝试将数据从 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)
这个错误是因为授予权限吗?我需要授予任何权限吗?或者这是一个连接错误?
我解决了 sqoop 命令并找到了这个解决方案。它对我有用。 我从 cmd ping 了主机名,发现了它正在 ping 到的 IP 地址。 我在 sqooop 执行命令中用 ipaddress 替换了主机名,它正在工作。