閱讀599 返回首頁    go 技術社區[雲棲]


Ambari 架構(四)Ambari Agent 架構

Ambari Agent 架構圖,由圖中看,主要有3部分:

  • HeartBeatHandler:發送 HTTP 請求和 Ambari Server 進行交互。
  • ActionExecutor:Command 執行器。
  • AlertSchedulerHandler:Alert 處理器。

4個數據容器:

  • CommandQueue:存儲需要執行的 Command。
  • ResultMap:存儲 Command 的執行結果。
  • Alert definitions file:是一個文件,保存所有的 Alert 定義。
  • AlertCollect:存儲 Alert 的檢查結果。

簡一下 Ambari Agent 的工作流程:

  1. HeartBeatHandler:收集組件當前狀態(通過ResultMap)、Command 執行結果(通過ResultMap)、Alert 檢查結果(通過 AlertCollect)等,封裝到 HTTP Request 當中,發送給 Ambari Server;Ambari Server 響應請求,通過 HTTP Response 帶回來需要執行的 Command、需要終止的 Command、發生修改的 Config、發生修改的 Alert 定義等,並把 Comand 和 修改的 Config 封裝為 Agent Command 對象,存儲到 CommandQueue 中;把修改的 Alert 定義,更新到 Alert definitions 文件中(如果 Alert definitions 文件發生了變化,需要通知 AlertSchedulerHandler 重新加載一遍
  2. ActionExecutor:定期從 CommandQueue 中加載需要執行的 Command,找到 Command 對應的 Python 腳本,執行腳本,並把結果存儲到 ResultMap 中。
  3. AlertSchedulerHandler:從 Alert definitions 文件中加載所有 Alert 定義,根據 Alert 定義,找到對應的 Python 腳本,周期性執行,並把結果存儲到 AlertCollect 中。

轉載自 並發編程網 - ifeve.com

最後更新:2017-05-18 11:02:04

  上一篇:go  sicp 4.3.2部分習題
  下一篇:go  sicp 4.3.1小節兩題