共用方式為


針對資料處理服務和遙測端點的連線性進行疑難排解

適用於:SQL Server

除了常用端點之外,適用於 SQL Server 的 Azure Arc 延伸模組會連線到另外兩個端點:

  • 資料處理服務 (DPS) 端點

    為了計費而收集的 SQL Server 執行個體、資料庫、可用性群組和使用方式資料的清查資訊會傳送至此端點。

  • 遙測端點

    Azure 連線機器代理程式記錄、Azure SQL Server 延伸模組的記錄,以及動態管理檢視 (DMV) 資料會傳送至此端點。

這些端點的通訊會使用 HTTPS 搭配 SSL/TLS 和連接埠 TCP/443 進行加密的安全連線。 代理程式會起始通訊,以將數據傳送 Azure。 Azure 永遠不會發起通訊。 因此,這些端點的連線性只是單向的。

當到這些端點的通訊遭到封鎖時,服務會出現下列徵兆:

  • 在 Azure 入口網站中看不到 SQL Server 執行個體。 DPS 端點被封鎖。
  • 在 SQL Server 執行個體效能儀表板檢視中看不到資料。 如果 DPS 端點已解除封鎖,但遙測端點被封鎖。
  • 您在 Azure 入口網站中看到 Azure 延伸模組的 SQL Server 狀態錯誤。 在 Azure 入口網站檢查 Azure 延伸模組的 SQL Server 狀態。
  • 在適用於 SQL Server 的 Azure 延伸模組記錄中看到錯誤。 檢 閱檢查適用於 SQL Server 記錄的 Azure 擴充功能

Azure 延伸模組目前狀態

您可以在入口網站中檢視適用於 SQL Server 的 Azure 延伸模組的目前狀態。 狀態每 15 分鐘重新整理一次。

良好狀態:

適用於 SQL Server 的 Azure 延伸模組入口網站螢幕快照,狀態良好。

不健康狀態

處於非正常狀態的 Azure 擴充功能的 SQL Server 入口網站螢幕快照。

檢查您是否有連線到 DPS 或遙測端點的問題

有兩種方式可以檢查您是否有連線到 DPS 或遙測端點的問題。

檢查 Azure 入口網站中適用於 SQL Server 的 Azure 延伸模組的狀態

如果通常會連接到 Azure,則適用於 SQL Server 的 Azure 延伸模組會在 Azure 入口網站報告其狀態。

  • 流覽至 Azure 入口網站中的 [機器 - Azure Arc] 檢視,然後依名稱找出機器並加以選取。
  • 選取 [擴充功能]
  • 選取 [WindowsAgent.SqlServer] 或 [LinuxAgent.SqlServer] 以顯示詳細資料。
  • 查看 [狀態訊息]uploadStatus 值。 如果狀態不是 OK,那麼連接到 DPS 時會發生問題。 0如果是 ,可能會有防火牆封鎖對 DPS 端點的通訊。 狀態訊息中可能有其他詳細資料,或 uploadStatus 錯誤碼可提供連線問題的深入解析。

檢查適用於 SQL Server 的 Azure 延伸模組記錄

延伸模組記錄檔位於:

C:\ProgramData\GuestConfig\extension_logs\Microsoft.AzureData.WindowsAgent.SqlServer\

記錄檔案名稱取決於適用於 SQL Server 的 Azure 延伸模組版本。 針對最新版的適用於 SQL Server 的 Azure 延伸模組,記錄檔為:

unifiedagent.log

針對版本 1.1.24724.69 及更早的延伸模組,記錄檔為:

ExtensionLog_0.log

檢查是否有記錄項目指出連線到 DPS 或遙測端點時發生問題。

探查 Web 伺服器端點

您可以使用各種工具來探查 DPS 和遙測的網頁伺服器端點。 例如,Invoke-WebRequestcurl

下列範例會使用 Invoke-Webrequest

Invoke-WebRequest telemetry.<region>.arcdataservices.com

可能的回覆狀態代碼為:

Invoke-WebRequest: Response status code does not indicate success: 401 (Unauthorized).

預期會返回 401 狀態碼,因為在遙測端點上沒有未經驗證的路徑。

針對 DPS:

Invoke-WebRequest dataprocessingservice.<region>.arcdataservices.com

對於美國政府弗吉尼亞州,將 取代 arcdataservices.comarcdataservices.azure.us。 此範例為:

Invoke-WebRequest dataprocessingservice.<region>.arcdataservices.azure.us

可能的回覆狀態代碼為:

StatusCode        : 200

StatusDescription : OK

預期回傳 200,因為這是一個未經驗證的路由。

檢測所有區域的連線能力

您可以使用 test-connectivity.ps1 PowerShell 腳本來探查所有區域的連線。

注意

針對美國政府弗吉尼亞地區,將 取代 arcdataservices.comarcdataservices.azure.us

#This script repeatedly probes all regions for connectivity to the Azure Arc data services/Arc-enabled SQL Server endpoints for telemetry and the data processing service.
#The script will output the status of the connectivity to the console.
#The script will run indefinitely until stopped by the user.
#The script will iterate through all regions in the $regions array.
#The list of regions are updated as of June 7,2024 to reflect all publicly available, supported Azure regions for Arc-enabled SQL Server.

$regions = @(
    "East US",
    "East US 2",
    "West US 2",
    "West US 3",
    "Central US",
    "North Central US",
    "South Central US",
    "West Central US",
    "Canada Central",
    "Canada East",
    "UK South",
    "UK West",
    "France Central",
    "West Europe",
    "North Europe",
    "Switzerland North",
    "Central India",
    "Brazil South",
    "South Africa North",
    "UAE North",
    "Japan East",
    "Korea Central",
    "Southeast Asia",
    "Australia East",
    "Sweden Central",
    "Norway East"
)

$regions = $regions | ForEach-Object { $_.Replace(" ", "") }

do{
    $regions | ForEach-Object {
        $dps_url =  "dataprocessingservice.$_.arcdataservices.com"
        $ti_url =  "telemetry.$_.arcdataservices.com"
        try{
            $dps_response_time = Measure-Command { $response = Invoke-WebRequest -Uri $dps_url -Method Get }
            $dps_result = ($response).StatusCode
        }catch{
            $dps_result = $_.Exception.Message
        }
        try{
            $ti_response_time = Measure-Command { $response = Invoke-WebRequest -Uri $ti_url -Method Get -SkipHttpErrorCheck }
        }catch{
            if($_.Exception.Message -like "*401*"){
                $ti_result = "Expected"
            }
            else {
                $ti_result = $_.Exception.Message
            }
        }
        if ($ti_response_time.TotalSeconds -gt 3 -or $dps_response_time.TotalSeconds -gt 3 -or $dps_result -ne 200 -or $ti_result -ne "Expected") {
            Write-Host $dps_result "($dps_response_time) " $ti_result " ($ti_response_time) :: $_" -ForegroundColor Red
        }
        elseif ($ti_response_time.TotalSeconds -gt 1 -or $dps_response_time.TotalSeconds -gt 1) {
            Write-Host $dps_result "($dps_response_time) " $ti_result " ($ti_response_time) :: $_" -ForegroundColor Yellow
        }
        else
        {
            Write-Host $dps_result "($dps_response_time) " $ti_result " ($ti_response_time) :: $_"
        }
    }
    Write-Host "====================================================================="
} while($true)

檢查TLS版本相容性

數據處理服務端點支援下列 TLS 版本:TLS 1.2 和 1.3。 不支援 Windows Server 2012 和舊版。

針對遙測端點,不支援 Windows Server 2012 R2 和較舊版本。

如果使用不支援的 TLS 版本,您可能會在記錄中看到錯誤

<date time>|ERROR|SqlServerExtension.Service|Request failed with exception 'System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.

---> System.Security.Authentication.AuthenticationException: Authentication failed because the remote party sent a TLS alert: 'HandshakeFailure'.

---> System.ComponentModel.Win32Exception (0x80090326): The message received was unexpected or badly formatted.

端點參照

若要連線到 Azure,端點會使用 *.arcdataservices.com

其他背景

適用於 SQL Server 的 Azure 擴充功能會使用下列端點:

  • DPS:dataprocessingservice.<region>.arcdataservices.com,或美國政府弗吉尼亞地區*.<region>.arcdataservices.azure.us
  • 遙測 telemetry.<region>.arcdataservices.com

以 Arc 機器資源所在的 Azure 區域的簡短名稱取代 <region>。 簡短名稱衍生自沒有空格和全部是小寫的 Azure 區域名稱。

例如,如果您的 Arc 機器資源位於 美國東部 2 ,則區域的簡短名稱是 eastus2 ,且遙測端點為:

telemetry.eastus2.arcdataservices.com

如果您的延伸模組早於 2024 年 3 月 11 日,它可能會使用較舊的端點。 更新您的延伸模組以使用目前的端點。

注意

*.arcdataservices.com 之前的端點值可能會變更。

使用 HTTPS Proxy 伺服器進行輸出連線

如果您的網路需要使用 HTTPS Proxy 伺服器進行輸出連線,您可以在 更新或移除 Proxy 設定中深入瞭解該設定。

查詢 Azure Resource Graph 以取得遙測上傳狀態

使用 Azure Resource Graph 查詢您環境的上傳狀態。

resources
    | where type =~ 'microsoft.hybridcompute/machines/extensions'
    | where properties.type in ('WindowsAgent.SqlServer','LinuxAgent.SqlServer')
    | parse id with * '/providers/Microsoft.HybridCompute/machines/' machineName '/extensions/' *
    | parse properties with * 'uploadStatus : ' uploadStatus ';' *
    | project uploadStatus, subscriptionId, resourceGroup, machineName
    | where uploadStatus !in ('OK') //comment this out to see all upload stats
    | order by uploadStatus desc

尋找長時間未連線到 DPS 的 SQL 延伸模組

查詢 Azure Resource Graph 以尋找最近未連線到 DPS 的延伸模組。

resources
    | where type =~ 'microsoft.hybridcompute/machines/extensions'
    | where properties.type in ('WindowsAgent.SqlServer','LinuxAgent.SqlServer')
    | parse id with * '/providers/Microsoft.HybridCompute/machines/' machineName '/extensions/' *
    | parse properties with * 'timestampUTC : ' timestampUTC ';' *
    | project timestampUTC, subscriptionId, resourceGroup, machineName
    | order by timestampUTC desc

錯誤碼

下表顯示一些常見的 DPS 上傳狀態值,以及您可以執行哪些動作來進一步進行疑難排解。

DPS 上傳狀態值 HTTP 錯誤碼 疑難排解建議
0 可能的原因:防火牆封鎖至 DPS 的資料傳輸。 開啟 DPS 的 DNS 端點防火牆 (TCP 埠:443)。
OK 200 連線如預期般運作。
Bad request 400 可能的原因:資源名稱 (SQL Server 執行個體或資料庫名稱) 不符合 Azure 資源命名慣例。 例如,如果資料庫名稱是 保留字則為 。
Unauthorized 401 可能的原因:延伸模組已設定為透過需要驗證的 HTTP Proxy 傳送資料。 目前不支援使用需要驗證的 HTTP Proxy。 使用未驗證的 HTTP 代理伺服器或不使用代理伺服器。
Forbidden 403 檢查以確定 Microsoft.AzureArcData 資源提供者已在訂用帳戶上註冊。 如果 Azure Connected Machine Agent 如預期般運作,且此錯誤在重新啟動後無法自行解決,請透過 Azure 入口網站建立 Microsoft 支援服務支援案例。
NotFound 404 延伸模組嘗試連線的端點不存在。

若要檢查其嘗試連線到哪個端點,請搜尋記錄中的 dataprocessingservice。 如果 Azure 連線機器代理程式已部署且連線到尚未提供 Microsoft.AzureArcData 資源提供者的 Azure 區域,就可能發生此情況。 在具有由 Azure Arc 啟用的 SQL Server 的資源提供者可用的區域中,重新部署 Azure 連接機器代理。 另請參閱 區域可用性
您的電腦可能未重新整理 DNS 解析快取。 若要重新整理:
- 在 Windows 上執行: ipconfig /flushdns
- 在 Linux 上執行 (如果使用 systemd 的話) 執行: sudo resolvectl flush-caches
Conflict 409 可能的原因:DPS 內部發生暫時性錯誤。 如果無法自行解決,請透過 Azure 入口網站與 Microsoft 支援建立支援案例。
InternalServerError 500 這是 DPS 內部發生的錯誤。 透過 Azure 入口網站建立具有 Microsoft 支援服務的支援案例。