JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Cluster Data Services Developer's Guide     Oracle Solaris Cluster 4.0
search filter icon
search icon

Document Information


1.  Overview of Resource Management

2.  Developing a Data Service

3.  Resource Management API Reference

4.  Modifying a Resource Type

5.  Sample Data Service

Overview of the Sample Data Service

Defining the Resource Type Registration File

Overview of the RTR File

Resource Type Properties in the Sample RTR File

Resource Properties in the Sample RTR File

System-Defined Properties in the RTR File

Extension Properties in the RTR File

Providing Common Functionality to All Methods

Identifying the Command Interpreter and Exporting the Path

Declaring the PMF_TAG and SYSLOG_TAG Variables

Parsing the Function Arguments

Generating Error Messages

Obtaining Property Information

Controlling the Data Service

How the Start Method Works

What the Start Method Does

Verifying the Configuration

Starting the Application

Start Exit Status

How the Stop Method Works

What the Stop Method Does

Stopping the Application

Stop Exit Status

Defining a Fault Monitor

How the Probe Program Works

What the Probe Program Does

Obtaining Property Values

Checking the Reliability of the Service

Comparing Restart With Failover

Restarting the Data Service

Probe Exit Status

How the Monitor_start Method Works

What the Monitor_start Method Does

Starting the Probe

How the Monitor_stop Method Works

What the Monitor_stop Method Does

Stopping the Monitor

Monitor_stop Exit Status

How the Monitor_check Method Works

Handling Property Updates

How the Validate Method Works

What the Validate Method Does

Validate Method Parsing Function

Validating Confdir

Validate Exit Status

How the Update Method Works

What the Update Method Does

Stopping the Monitor With Update

Restarting the Monitor

Update Exit Status

6.  Data Service Development Library

7.  Designing Resource Types

8.  Sample DSDL Resource Type Implementation

9.  Oracle Solaris Cluster Agent Builder

10.  Generic Data Service

11.  DSDL API Functions

12.  Cluster Reconfiguration Notification Protocol

A.  Sample Data Service Code Listings

B.  DSDL Sample Resource Type Code Listings

C.  Requirements for Non-Cluster-Aware Applications

D.  Document Type Definitions for the CRNP

E. Application


Defining the Resource Type Registration File

The resource type registration (RTR) file in this example defines the static configuration of the DNS resource type. Resources of this type inherit the properties that are defined in the RTR file.

The information in the RTR file is read by the Resource Group Manager (RGM) when the cluster administrator registers the HA-DNS data service. By convention, you place the RTR file in the /opt/cluster/lib/rgm/rtreg/ directory. Note that the package installer places the RTR file that Agent Builder creates in this directory as well.

Overview of the RTR File

The RTR file follows a well-defined format. Resource type properties are defined first in the file, system-defined resource properties are defined next, and extension properties are defined last. See the rt_reg(4) man page and Setting Resource and Resource Type Propertiesfor more information.

The following sections describe the specific properties in the sample RTR file. These sections provide listings of different parts of the file. For a complete listing of the contents of the sample RTR file, see Resource Type Registration File Listing.

Resource Type Properties in the Sample RTR File

The sample RTR file begins with comments followed by resource type properties that define the HA-DNS configuration, as shown in the following listing. The example assumes that previous versions of the resource type exist, so #$upgrade directives are included. See Specifying the #$upgrade and #$upgrade_from Directives for more information.

Note - Property names for resource groups, resources, and resource types are not case sensitive. You can use any combination of uppercase and lowercase letters when you specify property names.

# Copyright (c) 1998, 2011, Oracle and/or its affiliates.
# All rights reserved.
# Registration information for Domain Name Service (DNS)

#pragma ident   “@(#)ORCL.sample   1.3   00/05/24”

Resource_type = “sample”;
Vendor_id = ORCL;
RT_description = “Domain Name Service on Oracle Solaris Cluster”;

RT_version =”3”; 
API_version = 2;    
Failover = TRUE;

Pkglist = ORCLsample;

Start         =   dns_svc_start;
Stop          =   dns_svc_stop;

Validate      =   dns_validate;
Update        =   dns_update;

Monitor_start =   dns_monitor_start;
Monitor_stop  =   dns_monitor_stop;
Monitor_check =   dns_monitor_check;

#$upgrade_from "1" when_disabled 
#$upgrade_from "2" anytime

Tip - You must declare the Resource_type property as the first entry in the RTR file. Otherwise, registration of the resource type fails.

The following information describes these properties:

Resource type properties that are not specified in this RTR file, such as Single_instance, Init_nodes, and Installed_nodes, are set to their default values. Resource Type Properties contains a complete list of the resource type properties, including their default values.

The cluster administrator cannot change the values for resource type properties in the RTR file.

Resource Properties in the Sample RTR File

By convention, you declare resource properties after the resource type properties in the RTR file. Resource properties include system-defined properties that are provided by the Oracle Solaris Cluster software and extension properties that you define. For either type, you can specify a number of property attributes that are supplied by the Oracle Solaris Cluster software, such as minimum, maximum, and default values.

System-Defined Properties in the RTR File

The following listing shows the system-defined properties in a sample RTR file.

# A list of bracketed resource property declarations follows the
# resource type declarations. The property-name declaration must be
# the first attribute after the open curly bracket of each entry.

# The <method>_timeout properties set the value in seconds after which
# the RGM concludes invocation of the method has failed.

# The MIN value for all method timeouts is set to 60 seconds. This
# prevents administrators from setting shorter timeouts, which do not
# improve switchover/failover performance, and can lead to undesired
# RGM actions (false failovers, node reboot, or moving the resource group
# to ERROR_STOP_FAILED state, requiring operator intervention). Setting
# too-short method timeouts leads to a *decrease* in overall availability
# of the data service.
   PROPERTY = Start_timeout; 

   PROPERTY = Stop_timeout; 
   PROPERTY = Validate_timeout;
   PROPERTY = Update_timeout;
   PROPERTY = Monitor_Start_timeout;
   PROPERTY = Monitor_Stop_timeout;
   PROPERTY = Thorough_Probe_Interval;

# The number of retries to be done within a certain period before concluding 
# that the application cannot be successfully started on this node.
   PROPERTY = Retry_count;

# Set Retry_interval as a multiple of 60 since it is converted from seconds
# to minutes, rounding up. For example, a value of 50 (seconds)
# is converted to 1 minute. Use this property to time the number of 
# retries (Retry_count).
   PROPERTY = Retry_interval;

   PROPERTY = Network_resources_used;
   DEFAULT = ““;

Although the Oracle Solaris Cluster software provides the system-defined properties, you can set different default values by using resource property attributes. See Resource Property Attributes for a complete list of attributes that are available to you to apply to resource properties.

Note the following points about the system-defined resource properties in the sample RTR file:

Extension Properties in the RTR File

At the end of the sample RTR file are extension properties, as shown in this listing.

# Extension Properties

# The cluster administrator must set the value of this property to point to the
# directory that contains the configuration files used by the application.
# For this application, DNS, specify the path of the DNS configuration file on
# PXFS (typically named.conf).
   PROPERTY = Confdir;
   DESCRIPTION = “The Configuration Directory Path”;

# Time out value in seconds before declaring the probe as failed.
   PROPERTY = Probe_timeout;
   DEFAULT = 120;
   DESCRIPTION = “Time out value for the probe (seconds)”;

The sample RTR file defines two extension properties, Confdir and Probe_timeout. The Confdir property specifies the path to the DNS configuration directory. This directory contains the in.named file, which DNS requires to operate successfully. The sample data service's Start and Validate methods use this property to verify that the configuration directory and the in.named file are accessible before starting DNS.

When the data service is configured, the Validate method verifies that the new directory is accessible.

The sample data service's PROBE method is not an Oracle Solaris Cluster callback method but a user-defined method. Therefore, Oracle Solaris Cluster does not provide a Probe_timeout property for it. You need to define an extension property in the RTR file to enable a cluster administrator to configure a Probe_timeout value.