是否可以連接到SQL Server本地(不是Azure)從磚?
我想萍virtualbox虛擬機(與Windows Server 2022)從內部磚和請求超時。
% sh萍122.138.0.14
這是我的連接可能會是什麼樣子:
jdbcHostname = " 122.138.0.14 " jdbcDatabase = " AdventureWorksDW2019 "用戶名=“sa”密碼=“AStrongPassword jdbcPort = 1433 jdbcUrl = " jdbc::狀態"置疑" / / {0}:{1};dabatabse ={2};用戶={3};密碼= {4}\ .format (jdbcHostname、jdbcPort jdbcDatabase,用戶名,密碼)
但是當我試圖獲取數據表:
df_product = spark.read。jdbc (url = jdbcUrl表= DimProduct) df_address.display ()
我得到以下錯誤:
com.microsoft.sqlserver.jdbc。SQLServerException: The TCP/IP connection to the host 122.138.0.14, port 1433 has failed. Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
阿瑞亞@Alexander莫拉
但是磚在Azure,所以它需要以某種方式連接到On-Prem數據庫。
這意味著網絡連接需要被打開。