PROBE 메소드가 데이터 서비스를 포함하는 자원 그룹을 새 노드로 페일오버하려고 시도할 때마다 RGM은 Monitor_check 메소드를 호출합니다.
이 절에서는 샘플 응용 프로그램에 사용된 Monitor_check 메소드의 주요 부분에 대해 설명합니다. parse_args() 함수, syslog() 함수와 같이 모든 콜백 메소드에 공통된 기능은 다루지 않습니다. 공통된 기능에 대해서는 모든 메소드에 공통 기능 제공에서 설명합니다.
Monitor_check 메소드의 전체 목록은 Monitor_check 메소드 코드 목록을 참조하십시오.
동시에 실행되는 다른 메소드와 충돌하지 않도록 Monitor_check 메소드를 구현해야 합니다.
Monitor_check 메소드는 새 노드에서 DNS 구성 디렉토리를 사용할 수 있는지 확인하기 위해 Validate 메소드를 호출합니다. Confdir 확장 등록 정보는 DNS 구성 디렉토리를 가리킵니다. 따라서 Monitor_check은 다음에 나온 것처럼 Validate 메소드의 경로 및 이름과 Confdir의 값을 얻은 다음 이 값을 Validate에 전달합니다.
# Obtain the full path for the Validate method from # the RT_basedir property of the resource type. RT_BASEDIR=`scha_resource_get -O RT_basedir -R $RESOURCE_NAME \ -G $RESOURCEGROUP_NAM? # Obtain the name of the Validate method for this resource. VALIDATE_METHOD=`scha_resource_get -O Validate \ -R $RESOURCE_NAME -G $RESOURCEGROUP_NAM? # Obtain the value of the Confdir property in order to start the # data service. Use the resource name and the resource group entered to # obtain the Confdir value set at the time of adding the resource. config_info=`scha_resource_get -O Extension -R $RESOURCE_NAME \ -G $RESOURCEGROUP_NAME Confdir` # scha_resource_get returns the type as well as the value for extension # properties. Use awk to get only the value of the extension property. CONFIG_DIR=`echo $config_info | awk `{print $2}'` # Call the validate method so that the dataservice can be failed over # successfully to the new node. $RT_BASEDIR/$VALIDATE_METHOD -R $RESOURCE_NAME -G $RESOURCEGROUP_NAME \ -T $RESOURCETYPE_NAME -x Confdir=$CONFIG_DIR
샘플 응용 프로그램에서 데이터 서비스를 호스트하는 데 특정 노드가 적합한지 확인하는 방법에 대해서는 Validate 메소드 작동 방식을 참조하십시오.