Sun Cluster 数据服务开发者指南(适用于 Solaris OS)

xfnts_monitor_start 方法

在节点上启动资源后,RGM 将对该节点调用 Monitor_start 方法,以启动故障监视器。 xfnts_monitor_start 方法将使用 scds_pmf_start() 在 PMF 的控制下启动监视器守护程序。


注意:

xfnts_monitor_start 中首先调用的是 scds_initialize(),该函数可以执行一些必要的内务处理功能(scds_initialize() 函数scds_initialize(3HA) 手册页中包含了详细信息)。


xfnts_monitor_start 方法将调用在 xfnts.c 中定义的 mon_start 方法,如下所示。


scds_syslog_debug(DBG_LEVEL_HIGH,
      "Calling Monitor_start method for resource <%s>.",
      scds_get_resource_name(scds_handle));

    /* Call scds_pmf_start and pass the name of the probe. */
   err = scds_pmf_start(scds_handle, SCDS_PMF_TYPE_MON,
       SCDS_PMF_SINGLE_INSTANCE, "xfnts_probe", 0);

   if (err != SCHA_ERR_NOERR) {
      scds_syslog(LOG_ERR,
          "Failed to start fault monitor.");
      return (1);
   }

   scds_syslog(LOG_INFO,
       "Started the fault monitor.");

   return (SCHA_ERR_NOERR); /* Successfully started Monitor */
}

请注意以下关于在 svc_mon_start() 中调用 scds_pmf_start() 函数的内容。


注意:

在退出之前,xfnts_monitor_start 方法将调用 scds_close() 来回收通过 scds_initialize() 分配的资源。 有关详细信息,请参阅scds_initialize() 函数scds_close(3HA) 手册页。