从sql server导入表时,sqoop挂起

时间:2012-09-27 22:55:29

标签: sql-server-2008 hadoop hive sqoop

我正在尝试从SQL Server 2008 R2数据库导入一个简单的表到hive。

Hadoop version - CDH3U3
Sqoop version - 1.3.0-cdh3u3
$SQOOP_HOME/lib - sqljdbc4.jar
$SQOOP_HOME/lib - sqoop-sqlserver-1.0.jar
$SQOOP_CONF_DIR/managers.d/mssqoop-sqlserver

Windows firewall - disabled
Linux IPTables - disabled

我的导入命令是 -

sqoop import --connect 'jdbc:sqlserver://172.16.1.47;username=sa;password=asdf1234;database=test' --table bruce --hive-import --verbose

我没有看到任何错误消息,但它只是永远挂起。如果我查看SQL Server活动监视器,我可以看到正在创建一个进程。

这是sqoop输出 -

[root@sc-qa-test-01 bruce]# ./sqoop_test_sqlserver.sh<br>
Warning: /usr/lib/hbase does not exist! HBase imports will fail.<br>
Please set $HBASE_HOME to the root of your HBase installation.<br>
12/09/27 15:37:58 DEBUG tool.BaseSqoopTool: Enabled debug logging.<br>
12/09/27 15:37:58 INFO tool.BaseSqoopTool: Using Hive-specific delimiters for output. You can override<br>
12/09/27 15:37:58 INFO tool.BaseSqoopTool: delimiters with --fields-terminated-by, etc.<br>
12/09/27 15:37:58 DEBUG sqoop.ConnFactory: Added factory com.microsoft.sqoop.SqlServer.MSSQLServerManagerFactory specified by /usr/lib/sqoop/conf/managers.d/mssqoop-sqlserver<br>
12/09/27 15:37:58 DEBUG sqoop.ConnFactory: Loaded manager factory: com.microsoft.sqoop.SqlServer.MSSQLServerManagerFactory<br>
12/09/27 15:37:58 DEBUG sqoop.ConnFactory: Loaded manager factory: com.cloudera.sqoop.manager.DefaultManagerFactory<br>
12/09/27 15:37:58 DEBUG sqoop.ConnFactory: Trying ManagerFactory: com.microsoft.sqoop.SqlServer.MSSQLServerManagerFactory<br>
12/09/27 15:37:58 INFO SqlServer.MSSQLServerManagerFactory: Using Microsoft's SQL Server - Hadoop Connector<br>
12/09/27 15:37:58 INFO manager.SqlManager: Using default fetchSize of 1000<br>
12/09/27 15:37:58 DEBUG sqoop.ConnFactory: Instantiated ConnManager com.microsoft.sqoop.SqlServer.MSSQLServerManager@15aaf0b3<br>
12/09/27 15:37:58 INFO tool.CodeGenTool: Beginning code generation<br>
12/09/27 15:37:58 DEBUG manager.SqlManager: No connection paramenters specified. Using regular API for making connection.<br><br>

任何建议都将不胜感激。

2 个答案:

答案 0 :(得分:0)

您似乎正在使用Microsoft SQL Connector for Sqoop。作为第一步,我建议将其关闭,看看是否有帮助。

答案 1 :(得分:0)

使用以下命令

sqoop import --connect 'jdbc:sqlserver://172.16.1.47:<port_number>/test --table bruce --username sa --password asdf1234 --hive-import --hive-table <table_in_hive> --verbose

动态创建table_in_hive的地方