如果密码文件

时间:2018-03-19 15:18:13

标签: sql-server sqoop

我正在尝试将数据从HDFS导出到SQL Server,如果我提供密码作为参数,它可以正常工作。但是,如果我提供密码文件,则会失败。

密码文件只有一行,只有密码。在行尾没有新行或特殊字符。

同样的事情适用于Netezza,它只适用于SQL Server

  • Sqoop版本:1.4.6.2.5.3.0-37

  • Driver Jar:sqljdbc4-2.0.jar

命令:

sqoop export --connect "jdbc:sqlserver://abc.com:58850;databaseName=IKB_PROD;schema=dbo;" --table "SQOOP_TEST_SMALL" --export-dir /tmp/SQOOP_TEST_SMALL_20180101_010101 --username HADOOP_USR --password-file /user/gaurang.shah/sqlserver_password.pass --verbose

错误:

  

警告:/usr/hdp/2.5.3.0-37/accumulo不存在! Accumulo进口将失败   请将$ ACCUMULO_HOME设置为Accumulo安装的根目录   18/03/19 15:18:55 INFO sqoop.Sqoop:运行Sqoop版本:1.4.6.2.5.3.0-37
  18/03/19 15:18:55 DEBUG tool.BaseSqoopTool:启用调试日志记录   18/03/19 15:18:55 DEBUG password.FilePasswordLoader:从指定路径获取密码:/user/gaurang.shah/sqlserver_password.pass
  18/03/19 15:18:56 DEBUG sqoop.ConnFactory:已加载的经理工厂:org.apache.sqoop.manager.oracle.OraOopManagerFactory
  18/03/19 15:18:56 DEBUG sqoop.ConnFactory:已加载的经理工厂:com.cloudera.sqoop.manager.DefaultManagerFactory
  18/03/19 15:18:56 DEBUG sqoop.ConnFactory:试用ManagerFactory:org.apache.sqoop.manager.oracle.OraOopManagerFactory
  18/03/19 15:18:56 DEBUG oracle.OraOopManagerFactory:Sqoop可以调用Oracle和Hadoop的数据连接器!
  18/03/19 15:18:56 DEBUG sqoop.ConnFactory:试用ManagerFactory:com.cloudera.sqoop.manager.DefaultManagerFactory
  18/03/19 15:18:56 DEBUG manager.DefaultManagerFactory:尝试使用scheme:jdbc:sqlserver:
  18/03/19 15:18:56 INFO manager.SqlManager:使用1000的默认fetchSize   18/03/19 15:18:56 DEBUG sqoop.ConnFactory:实例化ConnManager org.apache.sqoop.manager.SQLServerManager@6f0628de
  18/03/19 15:18:56 INFO tool.CodeGenTool:开始代码生成       18/03/19 15:18:56 DEBUG manager.SqlManager:执行getColumnInfoRawQuery:SELECT t。* FROM [SQOOP_TEST_SMALL] AS t WHERE 1 = 0       18/03/19 15:18:56 DEBUG manager.SqlManager:没有指定连接参数。使用常规API进行连接。       18/03/19 15:18:56 ERROR manager.SqlManager:执行语句时出错:com.microsoft.sqlserver.jdbc.SQLServerException:用户登录失败' HADOOP_USR'。       com.microsoft.sqlserver.jdbc.SQLServerException:用户' HADOOP_USR'登录失败。           at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:196)           在com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:246)           在com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:83)           在com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2532)           在com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:1929)           在com.microsoft.sqlserver.jdbc.SQLServerConnection.access $ 000(SQLServerConnection.java:41)           在com.microsoft.sqlserver.jdbc.SQLServerConnection $ LogonCommand.doExecute(SQLServerConnection.java:1917)           在com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)           在com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)           在com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1061)           在com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:833)           在com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:716)           在com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:841)           在java.sql.DriverManager.getConnection(DriverManager.java:664)           在java.sql.DriverManager.getConnection(DriverManager.java:247)           在org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:904)           at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)           在org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:763)           在org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:786)           at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:289)           at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:260)           at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:246)           在org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:328)           at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1853)           在org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1653)           在org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)           在org.apache.sqoop.tool.ExportTool.exportTable(ExportTool.java:64)           在org.apache.sqoop.tool.ExportTool.run(ExportTool.java:100)           在org.apache.sqoop.Sqoop.run(Sqoop.java:147)           在org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)           在org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)           在org.apache.sqoop.Sqoop.runTool(Sqoop.java:225)           在org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)           在org.apache.sqoop.Sqoop.main(Sqoop.java:243)       18/03/19 15:18:56错误工具.ExportTool:遇到IOException运行导出作业:java.io.IOException:没有要为ClassWriter生成的列

0 个答案:

没有答案