本文介紹如何查看雲助手狀態,以及雲助手狀態異常時如何處理。
查看雲助手狀態
控制台
登入ECS管理主控台。
在左側導覽列,選擇 。
在頁面左側頂部,選擇目標資源所在的資源群組和地區。
在ECS執行個體頁簽下,查看雲助手狀態。
正常:雲助手運行良好,可以正常使用。
未安裝:執行個體上沒有安裝雲助手Agent,您可以參考以下方式安裝雲助手Agent。
單擊一鍵安裝自動化安裝雲助手Agent。
一鍵安裝雲助手Agent時,需要重啟執行個體才會生效。
手動安裝雲助手Agent,具體操作,請參見安裝雲助手Agent。
異常:出現異常的原因較多,需要根據具體原因來分析。更多資訊,請參見雲助手異常狀態處理。
API
調用DescribeCloudAssistantStatus,返回參數中"CloudAssistantStatus": "true"
代表雲助手狀態正常,如果狀態異常,請參見雲助手異常狀態處理。
雲助手異常狀態處理
Linux執行個體
遠端連線Linux執行個體。
具體操作,請參見使用Workbench工具以SSH協議登入Linux執行個體。
執行如下命令,查看雲助手安裝目錄是否存在。
CoreOS作業系統
cd /opt/local/share/ ls
其他動作系統(Alibaba Cloud Linux、Ubuntu、Debian、RedHat、SUSE Linux Enterprise Server和OpenSUSE等)
cd /usr/local/share/ ls
如果
aliyun-assist
檔案夾存在,請繼續執行步驟3。如果
aliyun-assist
檔案夾不存在,說明雲助手被卸載,需要重新安裝雲助手Agent。
查看雲助手服務狀態。
先確定ECS執行個體的初始化系統,不同核心版本的Linux系統,查看雲助手服務狀態命令不同。
ls -l /sbin/init
如果輸出指向
systemd
例如/lib/systemd/systemd
,說明系統使用systemd
。如果輸出指向
upstart
例如/sbin/upstart
,說明系統使用Upstart
。如果輸出指向
init
例如/sbin/init
,說明系統使用sysvinit
。
systemd
執行如下命令,查看雲助手狀態。
systemctl status aliyun.service
當雲助手狀態為
inactive (dead)
,說明雲助手服務已停止,需要執行systemctl start aliyun.service
啟動雲助手服務。如果啟動時報錯或無法啟動,請卸載雲助手後重新安裝。具體操作,請參見啟動、重啟、停止或者卸載雲助手Agent和Linux執行個體安裝雲助手Agent。
當雲助手狀態為
active (running)
,說明雲助手服務正常運行中,請繼續執行步驟4。
Upstart
執行如下命令,查看雲助手狀態。
/sbin/initctl status aliyun-service
當雲助手狀態為
stop/waiting
,說明雲助手服務已停止,需要執行/sbin/initctl start aliyun-service
啟動雲助手服務。如果啟動時報錯或無法啟動,請卸載雲助手後重新安裝。具體操作,請參見啟動、重啟、停止或者卸載雲助手Agent和Linux執行個體安裝雲助手Agent。
當雲助手狀態為
start/running
,說明雲助手服務正常運行中,請繼續執行步驟4。
sysvinit
執行如下命令,查看雲助手狀態。
/etc/init.d/aliyun-service status
當雲助手狀態為
Stopped
,說明雲助手服務已停止,需要執行/etc/init.d/aliyun-service start
啟動雲助手服務。如果啟動時報錯或無法啟動,請卸載雲助手後重新安裝。具體操作,請參見啟動、重啟、停止或者卸載雲助手Agent和Linux執行個體安裝雲助手Agent。
當雲助手狀態為
Running
,說明雲助手服務正常運行中,請繼續執行步驟4。
在控制台查看雲助手Agent狀態。
如果雲助手Agent狀態為正常,說明異常已解決。
如果雲助手Agent狀態依舊異常,需要查看雲助手日誌來具體分析。
CoreOS作業系統:
cd /opt/local/share/aliyun-assist/<version>/log tail -100f aliyun_assist_main.log
其他動作系統(Alibaba Cloud Linux、Ubuntu、Debian、RedHat、SUSE Linux Enterprise Server和OpenSUSE等):
cd /usr/local/share/aliyun-assist/<version>/log tail -100f aliyun_assist_main.log
Windows執行個體
遠端連線Windows執行個體。
具體操作,請參見使用Workbench工具以RDP協議登入Windows執行個體。
查看雲助手安裝目錄
C:\ProgramData\aliyun\assist
是否存在。如果aliyun-assist檔案夾存在,請繼續檢查雲助手狀態。
如果assist檔案夾不存在,說明雲助手被卸載,需要重新安裝雲助手,具體操作,請參見安裝雲助手Agent。
查看雲助手服務狀態。
單擊開始菜單,選擇
。選擇
。找到Aliyun Assist Service,查看Aliyun Assist Service狀態。
若狀態列為正常運行,表示Aliyun Assist Service狀態正常。
若狀態列無顯示,表示Aliyun Assist Service已停止,請單擊啟動,啟動Aliyun Assist Service。
如果啟動時報錯或無法啟動,請卸載雲助手後重新安裝。具體操作,請參見啟動、重啟、停止或者卸載雲助手Agent和Windows執行個體安裝雲助手Agent。
在控制台查看雲助手Agent狀態。
如果雲助手Agent狀態為正常,說明異常已解決。
如果雲助手Agent狀態還是異常,需要查看雲助手日誌來具體分析。
雲助手預設日誌路徑:
C:\ProgramData\aliyun\assist\<version>\log
,<version>
為雲助手Agent的具體版本號碼。
常見問題
為什麼雲助手日誌中出現context deadline exceeded (Client.Timeout exceeded while awaiting headers)
錯誤資訊?
出現該錯誤一般是ECS執行個體與雲助手伺服器間的網路連通異常,您可以運行以下命令,查看網路連通性。
請將<region-id>替換為地區的ID。更多資訊,請參見地區和可用性區域。
ping <region-id>.axt.aliyun.com
curl https://<region-id>.axt.aliyun.com/luban/api/instance/instance-id
正常情況下網域名稱能夠正常解析並且連通,且介面能夠返回正常的instance_id。
若不能解析或者不能正常返回執行個體ID,則說明執行個體網路存在問題,需要進行排查。具體操作,請參見配置雲助手Agent網路許可權。
為什麼受管理的執行個體註冊成功但顯示狀態異常?
若託管的執行個體顯示註冊成功,但云助手控制台顯示雲助手狀態異常,可以查看雲助手日誌是否出現invalid timestamp
錯誤。
雲助手預設日誌路徑如下,<version>為雲助手Agent的具體版本號碼。
Linux執行個體
CoreOS作業系統:/opt/local/share/aliyun-assist/<version>/log
其他動作系統(Alibaba Cloud Linux、Ubuntu、Debian、RedHat、SUSE Linux Enterprise Server和OpenSUSE等):/usr/local/share/aliyun-assist/<version>/log
Windows執行個體:C:\ProgramData\aliyun\assist\<version>\log
出現該錯誤是由於受管理的執行個體上的時間戳記和實際時間有誤差導致,可以嘗試校準ECS執行個體時間解決。更多資訊,請參見同步伺服器本地時間。
相關文檔
您可以通過ListPluginStatus來查詢執行個體中雲助手外掛程式的狀態。同時,您也可以在介面的返回資訊中,查看雲助手第一次上報外掛程式狀態的時間(FirstHeartbeatTime
參數)和雲助手最近一次上報外掛程式狀態的時間(LastHeartbeatTime
參數)。