Support Questions
Find answers, ask questions, and share your expertise

Sqoop Import Network Adaptor Error

Explorer

Hi ,

I am doing sqoop import from oracle using below command

sqoop import --connect jdbc:oracle:thin:@192.168.146.1:1521/orcl \ --username scott --password orcl --table emp --target-dir /tmp/test/ --m 1

But getting below error like

Please set $ACCUMULO_HOME to the root of your Accumulo installation. 16/06/14 17:41:29 INFO sqoop.Sqoop: Running Sqoop version: 1.4.5.2.2.0.0-2041 16/06/14 17:41:29 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead. 16/06/14 17:41:30 INFO oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop is disabled. 16/06/14 17:41:30 INFO manager.SqlManager: Using default fetchSize of 1000 16/06/14 17:41:30 INFO tool.CodeGenTool: Beginning code generation 16/06/14 17:42:31 ERROR manager.SqlManager: Error executing statement: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:548) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:564) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:251) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:29) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:563) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:215) at org.apache.sqoop.manager.OracleManager.makeConnection(OracleManager.java:327) at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:736) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:759) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:269) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:240) at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:226) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:295) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1773) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1578) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:96) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478) at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:601) 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) Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:436) at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:451) at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:897) at oracle.net.ns.NSProtocol.connect(NSProtocol.java:271) at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1663) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:385) ... 25 more Caused by: java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:146) at oracle.net.nt.ConnOption.connect(ConnOption.java:130) at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:402) ... 30 more 16/06/14 17:42:31 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: No columns to generate for ClassWriter at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1584) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:96) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478) at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:601) 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)

Please help me on this.

Regards

Abhishek

5 REPLIES 5

You have a "@" before the IP address. That should be used when you are specifying the username and password as part of the connect string. Since you are providing that as command line options, try removing "@":

 jdbc:oracle:thin:192.168.146.1:1521/orcl 

@Abhishek Srivastava

Please check if telnet to Oracle host as "telnet 192.168.146.1 1521" works fine from all the Data nodes.

Seems like issue as described in the below link:

http://stackoverflow.com/questions/33085157/unable-to-sqoop-the-data-from-sqloracle

Hope this helps.

Thanks and Regards,

Sindhu

Explorer

Please let me know how to do telnet in datanodes.

Regards

Abhishek

Hi,

This is firewall issue.

If you turned off the firewall then run this it will execute correctly.

Thanks in advance

New Contributor

If you are able to ping to Oracle server successfully that means you have connectivity. But if ping is not successful this can cause "The Network Adapter could not establish the connection". If connectivity is not there to Oracle Host then ask Oracle DBA to open port for your connection.