檢查上傳狀態和錯誤

您可以隨時查詢 Apigee API Hub for Private Cloud 連接器的本機狀態端點,查看中繼資料和執行階段資料的上傳狀態。

查看上傳狀態

在執行 Apigee API Hub for Private Cloud 連接器的虛擬機器上,使用下列 curl 指令:

curl localhost:8080/v1/uapim/status
成功的回應會傳回類似下列內容的 JSON 物件:
  {
 "apiSyncStatus": [
   {
     "organization": "foo",
     "phase": "Preparing",
     "components": [
       "proxy": {
         "lastUpdated": "2025-04-16T00:56:45Z",
         "progress": {
           "totalItems": 100,
           "pendingItems": 90,
           "completedItems": 6,
           "failedItems": 4
         }
       },
       "environment": { //environment upload status
         "lastUpdated": "2025-04-16T00:56:45Z",
         "progress": {
           "totalItems": 5,
           "pendingItems": 1,
           "completedItems": 3,
           "failedItems": 1
         }
       }]
   },
   {
     "organization": "bar",
     "phase": "Processing",
     "components": [
       "proxy": {
         "lastUpdated": "2025-04-16T00:56:45Z",
         "progress": {
           "totalItems": 110,
           "pendingItems": 16,
           "completedItems": 3,
           "failedItems": 1
         }
       },
       "environment": {
         "lastUpdated": "2025-04-16T00:56:45Z",
         "progress": {
           "totalItems": 5,
           "pendingItems": 3,
           "completedItems": 1,
           "failedItems": 1
         }
       }]
   },
   {
     "organization": "test",
     "phase": "Queued",
     "lastUpdated": "2025-04-16T00:56:45Z"
   }
 ],
 "analyticsSyncStatus": [
   {
     "organization": "test",
     "environment": "dev",
     "failedItems": 2,
     "lastUpdated": "2025-04-16T00:56:45Z"
   },
   {
     "organization": "test",
     "environment": "prod",
     "failedItems": 4,
     "lastUpdated": "2025-04-16T00:56:45Z"
   }
 ]
}

輸出內容會深入分析下列項目:

  • API 中繼資料:API 中繼資料上傳狀態,包括機構、環境、目前階段 (例如「準備中」、「處理中」、「已加入佇列」)、上傳總數/已完成/待處理、錯誤計數,以及上次更新時間。
  • 執行階段中繼資料:顯示執行階段資料上傳狀態,包括機構、環境、錯誤計數和上次更新時間。

常見問題和疑難排解步驟

如果遇到問題,請參閱連接器的記錄和狀態端點。Apigee Hub 連接器的主要記錄檔位於 /opt/apigee/var/log/edge-uapim-connector/edge-uapim-connector.log

  1. Apigee API Hub for Private Cloud 連接器未啟動
    • 檢查記錄:檢查 /opt/apigee/var/log/edge-uapim-connector/edge-uapim-connector.log 中是否有與設定相關的錯誤訊息。
    • 檢查設定:仔細檢查 uapim-connector.properties 和環境變數中的所有設定。
    • Pub/Sub 存取權:在記錄檔中確認 opdk-connector 是否能存取提供的 Pub/Sub 主題。
    • 管理伺服器存取權:檢查記錄,確認 opdk-connector 是否能使用指定網址和憑證呼叫 Apigee 管理伺服器。
    • 啟動時間:如果 Apigee 環境中有數千個部署作業,Apigee 中心連接器可能需要大約 20 到 30 分鐘才能啟動。
  2. API 中繼資料未顯示在 API 中心
    • 連結器記錄:查看 opdk-connector 記錄,確認連結器是否可以存取 API 中繼資料 Pub/Sub 主題,並呼叫管理伺服器。
    • 上傳狀態:檢查 curl localhost:8080/v1/uapim/status 輸出內容。尋找「APIMetadata」部分。
      • lastUpdated 是否為近期更新?
      • errorCount 是否持續增加?
      • 目前處於哪個階段?
    • 例外狀況/錯誤:在記錄檔中搜尋與中繼資料處理相關的任何例外狀況或錯誤。
  3. API 中樞未顯示執行階段資料
    • 連接器記錄:檢查 opdk-connector 是否可存取執行階段 Pub/Sub 主題,並呼叫管理伺服器。
    • 上傳狀態:使用 curl localhost:8080/v1/uapim/status 指令。請著重於「RuntimeData」部分。
      • lastUpdated 是否為近期更新?
      • errorCount 是否持續增加?
    • 例外狀況/錯誤:在與執行階段資料處理相關的記錄中,尋找任何例外狀況或錯誤。
    • 訊息處理器設定:請確認所有訊息處理器都已正確設定雙重寫入功能,並已重新啟動。message-processor-communication.properties
    • NFS 掛接:確認 NFS 掛接設定正確,且 MP 和 UAPIM 連接器都能存取。
  4. 已部署 Proxy,但 API 中心中的資訊不正確
    • 等待時間:資料傳播需要幾分鐘的時間。
    • 記錄:查看 opdk-connector 記錄,瞭解已上傳 Proxy 的相關資訊。這有助於判斷連接器是否正在處理部署事件。