天天看點

pacemaker資源代理

Resource Agent叢集資源代理

  • 在 Pacemaker叢集中,每一個原始資源都有一個資源代理(Resource Agent, RA), RA是一個與資源相關的外部腳本程式,該程式抽象了資源本身所提供的服務并向叢集呈現一緻的視圖以供叢集對該資源進行操作控制。通過 RA,幾乎任何應用程式都可以成為 Pacemaker叢集的資源進而被叢集資料總管和控制。RA的存在,使得叢集資料總管可以對其所管理的資源“不求甚解",即叢集資料總管無需知道資源具體的工作邏輯和原理( RA已将其封裝),資料總管隻需向 RA發出 start、 stop、Monitor等指令, RA便會執行相應的操作。從資料總管對資源的控制過程來看,叢集對資源的管理完全依賴于該資源所提供的,即資源的 RA腳本功能直接決定了資料總管可以對該資源進行何種控制,是以一個功能完善的 RA在發行之前必須經過充分的功能測試。在多數情況下,資源 RA以 shell腳本的形式提供,當然也可以使用其他比較流行的如 c、 python、 perl等語言來實作 RA。

Pacemaker 支援三種類型的 RA:

  • LSB Resource Agents
  • OCF Resource Agents
  • legacy Heartbeat Resource Agents

主流的 RA 都是 OCF 類型的。RA 支援的主要操作包括:

  • start: enable or start the given resource
  • stop: disable or stop the given resource
  • monitor: check whether the given resource is running (and/or doing useful work), return status as running or not running
  • validate-all: validate the resource's configuration
  • meta-data: return information about the resource agent itself (used by GUIs and other management utilities, and documentation tools)
  • some more, see OCF Resource Agents and the Pacemaker documentation for details.

    更多RA腳本請轉https://github.com/ClusterLabs/resource-agents

繼續閱讀