hivesqoop

Sqoop connection to MS SQL Server named instance


What is the proper Sqoop code to connect to a SQL Server Named instance? I knew code for connecting to the default instance, but could not find anything about the named instance. Below is my code, which does not work.

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

The error messages are:

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.

Solution

  • Please try this

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