針對 Azure Linux 代理程式進行疑難解答

注意事項

本文是否有幫助? 您的輸入對我們很重要。 請使用此頁面上的 [ 意見反應 ] 按鈕,讓我們知道本文如何為您運作,或我們如何加以改善。

Azure Linux 代理程式可讓虛擬機 (VM) 與網狀架構控制器通訊, (VM 裝載於 IP 位址 168.63.129.16 的基礎實體伺服器) 。

注意事項

此IP位址是可促進通訊的虛擬公用IP位址,不應遭到封鎖。 如需詳細資訊,請 參閱什麼是IP位址168.63.129.16?

開始之前

檢查代理程序狀態和版本,以確定仍然受到支援。 請參閱 Azure 中虛擬機代理程式的最低版本支援 以檢查版本支援,或參閱 WALinuxAgent 常見問題 ,以取得尋找狀態和版本的步驟。

針對未就緒狀態進行疑難解答

  1. 檢查 Azure Linux 代理程式的服務狀態,以確定其正在執行中。 服務名稱可能是 walinuxagentwaagent

    root@nam-u18:/home/nam# service walinuxagent status
    ● walinuxagent.service - Azure Linux Agent
       Loaded: loaded (/lib/systemd/system/walinuxagent.service; enabled; vendor preset: enabled)
       Active: active (running) since Thu 2020-10-08 17:10:29 UTC; 3min 9s ago
     Main PID: 1036 (python3)
        Tasks: 4 (limit: 4915)
       CGroup: /system.slice/walinuxagent.service
               ├─1036 /usr/bin/python3 -u /usr/sbin/waagent -daemon
               └─1156 python3 -u bin/WALinuxAgent-2.2.51-py2.7.egg -run-exthandlers
    Oct 08 17:10:33 nam-u18 python3[1036]: 2020-10-08T17:10:33.129375Z INFO ExtHandler ExtHandler Started tracking cgroup: Microsoft.OSTCExtensions.VMAccessForLinux-1.5.10, path: /sys/fs/cgroup/memory/sys
    Oct 08 17:10:35 nam-u18 python3[1036]: 2020-10-08T17:10:35.189020Z INFO ExtHandler [Microsoft.CPlat.Core.RunCommandLinux-1.0.1] Target handler state: enabled [incarnation 2]
    Oct 08 17:10:35 nam-u18 python3[1036]: 2020-10-08T17:10:35.197932Z INFO ExtHandler [Microsoft.CPlat.Core.RunCommandLinux-1.0.1] [Enable] current handler state is: enabled
    Oct 08 17:10:35 nam-u18 python3[1036]: 2020-10-08T17:10:35.212316Z INFO ExtHandler [Microsoft.CPlat.Core.RunCommandLinux-1.0.1] Update settings file: 0.settings
    Oct 08 17:10:35 nam-u18 python3[1036]: 2020-10-08T17:10:35.224062Z INFO ExtHandler [Microsoft.CPlat.Core.RunCommandLinux-1.0.1] Enable extension [bin/run-command-shim enable]
    Oct 08 17:10:35 nam-u18 python3[1036]: 2020-10-08T17:10:35.236993Z INFO ExtHandler ExtHandler Started extension in unit 'Microsoft.CPlat.Core.RunCommandLinux_1.0.1_db014406-294a-49ed-b112-c7912a86ae9e
    Oct 08 17:10:35 nam-u18 python3[1036]: 2020-10-08T17:10:35.263572Z INFO ExtHandler ExtHandler Started tracking cgroup: Microsoft.CPlat.Core.RunCommandLinux-1.0.1, path: /sys/fs/cgroup/cpu,cpuacct/syst
    Oct 08 17:10:35 nam-u18 python3[1036]: 2020-10-08T17:10:35.280691Z INFO ExtHandler ExtHandler Started tracking cgroup: Microsoft.CPlat.Core.RunCommandLinux-1.0.1, path: /sys/fs/cgroup/memory/system.sl
    Oct 08 17:10:37 nam-u18 python3[1036]: 2020-10-08T17:10:37.349090Z INFO ExtHandler ExtHandler ProcessGoalState completed [incarnation 2; 4496 ms]
    Oct 08 17:10:37 nam-u18 python3[1036]: 2020-10-08T17:10:37.365590Z INFO ExtHandler ExtHandler [HEARTBEAT] Agent WALinuxAgent-2.2.51 is running as the goal state agent [DEBUG HeartbeatCounter: 1;Heartb
    root@nam-u18:/home/nam#
    

    如果服務正在執行,請重新啟動它以解決問題。 如果服務停止,請啟動它,等候幾分鐘,然後再次檢查狀態。

  2. 請確定已啟用自動更新。 檢查 /etc/waagent.conf 中的自動更新設定。

    AutoUpdate.Enabled=y
    

    如需如何更新 Azure Linux 代理程式的詳細資訊,請參閱 如何更新 VM 上的 Azure Linux 代理程式

  3. 請確定 VM 可以連線到網狀架構控制器。 使用 curl 之類的工具來測試 VM 是否可以在埠 80、443 和 32526 上連線到 168.63.129.16。 如果 VM 未如預期般連線,請檢查 VM 上的本機防火牆中是否已開啟透過埠 80、443 和 32526 的輸出通訊。 如果此IP位址遭到封鎖,VM 代理程式可能會顯示非預期的行為。

進階疑難排解

針對 Azure Linux 代理程式進行疑難解答的事件會記錄在 /var/log/waagent.log 檔案中。

無法連線到WireServerIP (主機IP)

當 VM 無法連線到主機伺服器上的 WireServer IP 時 ,/var/log/waagent.log 檔案中會出現下列錯誤。

2020-10-02T18:11:13.148998Z WARNING ExtHandler ExtHandler An error occurred while retrieving the goal state:

若要解決此問題:

  • 使用 SSH 連線到 VM,然後執行下列命令來測試 VM 與 WireServer 之間的連線。 執行命令需要根許可權。

    curl http://168.63.129.16/?comp=versions
    
  • 檢查防火牆、Proxy 或其他可能封鎖IP位址168.63.129.16存取的來源所造成的任何問題。

  • 檢查 Linux IPTable 或第三方防火牆是否封鎖埠 80 和 32526 的存取。

與我們連絡,以取得說明

如果您有問題或需要相關協助,請建立支援要求,或詢問 Azure community 支援。 您也可以將產品意見反應提交給 Azure 意應見反社群