gpt4 book ai didi

oracle - Sqoop ORACLE SSL JDBC 网络适配器无法使用 TCPS 协议(protocol)建立连接

转载 作者:太空宇宙 更新时间:2023-11-03 14:39:02 29 4
gpt4 key购买 nike

我正在尝试使用 SSL 连接将(SQOOP)表数据从 ORACLE DB 导入到 HDFS。

我使用的Sqoop命令如下,

sqoop import -Djavax.net.ssl.trustStore=/app/Wallets/client_wallet/ewallet.p12 -Djavax.net.ssl.trustStoreType=PKCS12 -Djavax.net.ssl.trustStorePassword=WalletPasswd123 --connect jdbc:oracle:thin:@testssl --username test --password test --table APP_INSTANCE

错误:

17/06/30 18:43:12 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6
17/06/30 18:43:12 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
17/06/30 18:43:13 DEBUG tool.BaseSqoopTool: Enabled debug logging.
17/06/30 18:43:13 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
17/06/30 18:43:13 DEBUG sqoop.ConnFactory: Loaded manager factory: org.apache.sqoop.manager.oracle.OraOopManagerFactory
17/06/30 18:43:13 DEBUG sqoop.ConnFactory: Loaded manager factory: com.cloudera.sqoop.manager.DefaultManagerFactory
17/06/30 18:43:13 WARN sqoop.ConnFactory: Parameter --driver is set to an explicit driver however appropriate connection manager is not being set (via --connection-manager). Sqoop is going to fall back to org.apache.sqoop.manager.GenericJdbcManager. Please specify explicitly which connection manager should be used next time.
17/06/30 18:43:13 INFO manager.SqlManager: Using default fetchSize of 1000
17/06/30 18:43:13 INFO tool.CodeGenTool: Beginning code generation
17/06/30 18:43:13 DEBUG manager.SqlManager: Execute getColumnInfoRawQuery : SELECT t.* FROM APP_INSTANCE AS t WHERE 1=0
17/06/30 18:43:13 DEBUG manager.SqlManager: No connection paramenters specified. Using regular API for making connection.
17/06/30 18:43:14 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:458)

tnsnames.ora:

testssl =   (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCPS)(HOST = IP )(PORT = 2484))
(CONNECT_DATA = (SERVER = dedicated)(SERVICE_NAME = ORACL)))

sqlnet.ora:

WALLET_LOCATION=(SOURCE=(METHOD=FILE)  
(METHOD_DATA=(DIRECTORY=/app/Wallets/client_wallet)))
SQLNET.AUTHENTICATION_SERVICES = (tcps)
SSL_CIPHER_SUITES = (SSL_RSA_WITH_AES_128_CBC_SHA,SSL_DH_anon_WITH_3DES_EDE_CBC_SHA)
SSL_CLIENT_AUTHENTICATION = FALSE

尝试使用 SQLPLUS:

$ sqlplus64 neon_main/bullet@testssl

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jun 30 19:23:58 2017

Copyright (c) 1982, 2011, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

这工作正常。但不使用 JDBC。

请指出哪里不对?

最佳答案

因为您使用的是 TNS 名称别名,所以您应该明确传递 -Doracle.net.tns_admin=。此外,JDBC thin 不会读取文件 sqlnet.ora。因此,这些属性需要作为连接级别属性显式传递。

查看 SSL with JDBC whitepaper更多细节。

关于oracle - Sqoop ORACLE SSL JDBC 网络适配器无法使用 TCPS 协议(protocol)建立连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44848252/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com