Solaris OS용 Sun Cluster 데이터 서비스 개발 안내서

xfonts_probe 주 루프

xfonts_probe 메소드는 루프를 구현합니다. 루프를 구현하기 전에 xfonts_probe는 다음 작업을 수행합니다.

xfnts_probe 메소드는 다음과 같이 루프를 구현합니다.

for (ip = 0; ip < netaddr->num_netaddrs; ip++) {
         /*
          * Grab the hostname and port on which the
          * health has to be monitored.
          */
         hostname = netaddr->netaddrs[ip].hostname;
         port = netaddr->netaddrs[ip].port_proto.port;
         /*
          * HA-XFS supports only one port and
          * hence obtain the port value from the
          * first entry in the array of ports.
          */
         ht1 = gethrtime(); /* Latch probe start time */
         scds_syslog(LOG_INFO, "Probing the service on port: %d.", port);

         probe_result =
         svc_probe(scds_handle, hostname, port, timeout);

         /*
          * Update service probe history,
          * take action if necessary.
          * Latch probe end time.
          */
         ht2 = gethrtime();

         /* Convert to milliseconds */
         dt = (ulong_t)((ht2 - ht1) / 1e6);

         /*
          * Compute failure history and take
          * action if needed
          */
         (void) scds_fm_action(scds_handle,
             probe_result, (long)dt);
      }   /* Each net resource */
   }    /* Keep probing forever */

svc_probe() 함수는 검사 논리를 구현합니다. svc_probe() 반환값이 scds_fm_action()으로 전달되고, 여기서 응용 프로그램을 다시 시작할지, 자원 그룹을 페일오버할지, 아니면 아무 작업도 수행하지 않을지 결정합니다.