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

適用於:✔️ Linux VM

注意

本篇文章實用嗎? 您的輸入對我們很重要。 請使用此頁面上的 [ 意見反應 ] 按鈕,讓我們知道這篇文章為您運作得有多好,或我們如何加以改善。

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

注意

此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 檔案中

無法連線到 WireServer IP (主機 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 IPTables 或第三方防火牆是否封鎖存取連接埠 80 和 32526。

與我們連絡,以取得說明

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