Show Table of Contents
8.3. 监控资源的事件通知
Pacemaker 集群是一个事件驱动系统,其中事件可以是资源失败,或配置更改。
ocf:pacemaker:ClusterMon 资源可监控集群状态,并触发每个集群事件警报。这个资源以常规间隔在后端运行 crm_mon,并使用 crm_mon 功能发送电子邮件信息(SMTP)。它还可以使用 extra_options 参数执行外部程序。
以下示例配置名为
ClusterMon-SMTP 的 ClusterMon 资源,该资源将发送电子邮件通知。Pacemaker 事件会导致从 pacemaker@nodeX.example.com 使用电子邮件主机 mail.example.com 向 pacemaker@example.com 发送电子邮件。这个资源可作为克隆创建,以便在集群的所有节点中运行。
# pcs resource create ClusterMon-SMTP ClusterMon --clone user=root update=30 \ extra_options="-T pacemaker@example.com -F pacemaker@nodeX.example.com \ -P PACEMAKER -H mail.example.com"
以下示例配置名为
ClusterMon-External 的 ClusterMon 资源,运行程序 /usr/local/bin/example.sh,以便决定如何就集群通知进行操作。这个资源可作为克隆创建,以便在集群的每个节点中运行。
# pcs resource create ClusterMon-External ClusterMon --clone user=root \ update=30 extra_options="-E /usr/local/bin/example.sh -e 192.168.12.1" 
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.