与MS SQL Server命名实例的Sqoop连接

时间:2019-05-17 21:29:32

标签: hive instance sqoop connect named

连接到SQL Server命名实例的正确Sqoop代码是什么?我知道用于连接默认实例的代码,但是找不到有关命名实例的任何信息。下面是我的代码,它不起作用。

sqoop list-databases --connect 'jdbc:sqlserver://abc:1433\sql1;username=abc;password=abc'

错误消息是:

Warning: /usr/hdp/3.1.0.0-78/accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/3.1.0.0-78/hadoop/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/3.1.0.0-78/phoenix/phoenix-5.0.0.3.1.0.0-78-server.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/3.1.0.0-78/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
19/05/17 14:03:45 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7.3.1.0.0-78
19/05/17 14:03:45 INFO manager.SqlManager: Using default fetchSize of 1000
19/05/17 14:03:45 ERROR manager.CatalogQueryManager: Failed to list databases
com.microsoft.sqlserver.jdbc.SQLServerException: The port number 1433\sql1 is not valid.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:227)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1340)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:866)
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:569)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:270)
        at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:902)
        at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:59)
        at org.apache.sqoop.manager.CatalogQueryManager.listDatabases(CatalogQueryManager.java:57)
        at org.apache.sqoop.tool.ListDatabasesTool.run(ListDatabasesTool.java:49)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:150)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:186)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:240)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:249)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:258)
19/05/17 14:03:45 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: com.microsoft.sqlserver.jdbc.SQLServerException: The port number 1433\sql1 is not valid.
java.lang.RuntimeException: com.microsoft.sqlserver.jdbc.SQLServerException: The port number 1433\sql1 is not valid.

1 个答案:

答案 0 :(得分:0)

请尝试这个

sqoop list-tables -Dmapreduce.job.queuename=<yourqueue> — connect "jdbc:sqlserver://<sqlserverhost>\\instancename:<sqlserver port>;database=<sqlserver database>;username=<sqlserver user>;password=<sqlserver password>"