Sun Cluster 3.0 12/01 Release Notes Supplement

Using the SunPlex Agent Builder to Create a Service Using GDS

You can use the SunPlex Agent Builder to create the service that uses GDS. See the Sun Cluster 3.0 12/01 Data Services Developer's Guide for information on the SunPlex Agent Builder as well as a definition of the fields.

Create a Service Using GDS in the SunPlex Agent Builder

Creating a Service Using GDS in the Agent Builder
  1. Bring up the SunPlex Agent Builder.


    # /usr/cluster/bin/scdsbuilder
    
  2. The SunPlex Agent Builder panel appears.

    Graphic
  3. Enter the Vendor Name.

  4. Enter the Application Name.


    Note -

    The combination of Vendor and Application Name may not contain more than nine characters. It will be used as the name of the package for the driving scripts.


  5. Enter the Working Directory. You can use the Browse pull-down to select the directory rather than typing the path.

  6. Select whether the data service is scalable or failover.

  7. You do not need to select Network Aware since that is the default when creating GDS.

  8. Select GDS.

  9. Click the Create button to create the driving scripts.

    The SunPlex Agent Builder panel displays the results of the creation of the service. The Create button is grayed out and the Next button is now available.

    Graphic
Configuring the Driving Scripts of the Service

After creating the driving scripts, you need to use the SunPlex Agent Builder to configure the new service.

  1. Click the Next button and the configuration panel appears.

    Graphic
  2. Either enter the location of the Start command or use the browse button to locate the Start command.

  3. (Optional) Enter the Stop command or use the browse button to locate the Stop command.

  4. (Optional) Enter the Probe command or use the browse button to locate the Probe command.

  5. (Optional) Specify the timeout values for the Start, Stop, and Probe commands.

  6. Click Configure to start the configuration of the driving scripts.


    Note -

    The package name will consist of a concatenation of the Vendor Name and Application Name.


    A package for driving scripts will be created and placed in the following file:


    <working-dir>/<vendor_name><application>/pkg
    

    For example, /usr/local/wdir/NETapp/pkg.

  7. Install the completed package on both nodes of the cluster.


    # cd /usr/local/wdir/NETapp/pkg
    # pkgadd -d . NETapp
    

  8. The following files will be installed during the pkgadd:


    /opt/NETapp
    /opt/NETapp/README.app
    /opt/NETapp/man 
    /opt/NETapp/man/man1m
    /opt/NETapp/man/man1m/removeapp.1m
    /opt/NETapp/man/man1m/startapp.1m
    /opt/NETapp/man/man1m/stopapp.1m
    /opt/NETapp/man/man1m/app_config.1m
    /opt/NETapp/util
    /opt/NETapp/util/removeapp
    /opt/NETapp/util/startapp
    /opt/NETapp/util/stopapp
    /opt/NETapp/util/app_config


    Note -

    The man pages and script names will correspond to the Application Name you entered above preceded by the script name; for example, startappname.


    To view the man pages, you need to specify the path to the man page. For example, to view the startapp man pages, use the following command:


    % man -M /opt/NETapp/man startapp
    
  9. On one node of the cluster, configure the resources and start the application.


    # /opt/NETapp/util/startapp -h logichostname \
    -p port-and-protocol-list
    

    The arguments to the start script will vary according to the type of resource: failover or scalable. Check the customized man page or run the start script without any argument to get a usage statement.


    # /opt/NETapp/util/startapp
    The resource name of LogicalHostname or SharedAddress must be specified. 
    
    For failover services: 
    Usage: startapp -h <logical host name>
          -p <port and protocol list>
          [-n <nafogroup/adapter list>]
          [-v]
    
    For scalable services:
    Usage: startapp 
          -h <shared address name>
          -p <port and protocol list>
          [-l <load balancing policy>] 
          [-n <nafogroup/adapter list>]
          [-w <load balancing weights>] [-v] 
    For stand-alone (non-network aware applications):
    Usage: startapp [-v]

Output from SunPlex Agent Builder

The SunPlex Agent Builder generates three driving scripts based on input you provide during package creation as well as a configuration file. The configuration files specify the names of the resource group and resource type.

Customizable Driving Scripts

The following are the driving scripts:

You can customize these scripts to provide your own names for resource groups or other parameters that are normally given as inputs to the scrgadm command. If you do not customize the scripts, the driving scripts will provide reasonable defaults for the scrgadm parameters.

Configuration File for an HA Service

Following is a sample configuration file for a highly available service. The default name for the resource group and resource application are applicationname-hars and applicationname-harg where applicationname is the name of the application that you specified to the SunPlex Agent Builder.

You can modify these names if you want to use an existing resource group. You must make any required changes before you run the start script. Open the configuration file using your favorite editor and make the changes.


#
# Parameter file for application generated by SunPlex Data Service # Builder
#
# This file will be sourced in by startapp, stopapp and removeapp
# The parameters listed below will be used in those scripts.
# These parameters can be customized in (key=value) form
#
# RS_NAME:      name of the resource for the application
# RG_NAME:      name of the resource group containing RS_NAME
# MAXIMUM_PRIMARIES: Maximum primaries of RG_NAME
# DESIRED_PRIMARIES: Desired primaries of RG_NAME
#
# For example:
#
# RS_NAME=rs_app
# RG_NAME=rg_app
# MAXIMUM_PRIMARIES=1
# DESIRED_PRIMARIES=1
#
RS_NAME=app-hars
RG_NAME=app-harg
MAXIMUM_PRIMARIES=1
DESIRED_PRIMARIES=1

Configuration File for Scalable Services

Following is a sample configuration file for a scalable service. The default names for the resource application and resource group are applicationname-sars and applicationname-sarg where applicationname is the name of the application that you specified to the SunPlex Agent Builder. The name of the SharedAddress resource is the concatenation of sa-rg- and the name of the SharedAddress.

You can modify these names if you want to use an existing resource group or SharedAddress. You must make any required changes before you run the start script.

Open the configuration file using your favorite editor and make any required changes.


#
# Parameter file for application generated by SunPlex Data Service # Builder
#
# This file will be sourced in by startecho, stopecho and removeecho
# The parameters listed below will be used in those scripts.
# These parameters can be customized in (key=value) form
#
# RS_NAME:      name of the resource for the application
# RG_NAME:      name of the resource group containing RS_NAME
# SA_RG_NAME:   the resource group containing the Shared Address resource
# MAXIMUM_PRIMARIES: Maximum primaries of RG_NAME
# DESIRED_PRIMARIES: Desired primaries of RG_NAME
#
# For example:
#
# RS_NAME=rs_echo
# RG_NAME=rg_echo
# SA_RG_NAME=sa_rg
# MAXIMUM_PRIMARIES=4
# DESIRED_PRIMARIES=4
#
RS_NAME=echo-sars
RG_NAME=echo-sarg
SA_RG_NAME=sa-rg-${HOSTNAME}
MAXIMUM_PRIMARIES=${NO_OF_NODES}
DESIRED_PRIMARIES=${NO_OF_NODES}

Command Line Equivalent of the SunPlex Agent Builder

You can use the command line interface to create a service that uses DGS that is the equivalent of using the SunPlex Agent Builder.

Creating A Service that Uses GDS Using the Command Line Equivalent of the SunPlex Agent Builder
  1. Create the service.

    For a failover service, use the following command:


    # scdscreate -g -V NET -T app -d /usr/local/wdir
    

    For a scalable service, use the following command:


    # scdscreate -g -s -V NET -T app -d /usr/local/wdir
    

    Note -

    The -d parameters are optional. If it is not specified, the working directory defaults to the current directory.


  2. Configure the service.


    # scdsconfig -s "/usr/local/app/bin/start' \
    -t "/usr/local/app/bin/stop" \
    -m "/usr/local/app/bin/probe" \
    -d /usr/local/wdir
    


    Note -

    Only the start command is required. All other parameters are optional.


  3. Install the completed package on both nodes of the cluster.


    # cd /usr/local/wdir/NETapp/pkg
    # pkgadd -d . NETapp
    

  4. The following files will be installed during the pkgadd:


    /opt/NETapp
    /opt/NETapp/README.app
    /opt/NETapp/man
    /opt/NETapp/man/man1m
    /opt/NETapp/man/man1m/removeapp.1m
    /opt/NETapp/man/man1m/startapp.1m
    /opt/NETapp/man/man1m/stopapp.1m
    /opt/NETapp/man/man1m/app_config.1m
    /opt/NETapp/util
    /opt/NETapp/util/removeapp 
    /opt/NETapp/util/startapp
    /opt/NETapp/util/stopapp
    /opt/NETapp/util/app_config


    Note -

    The man pages and script names will correspond to the Application Name you entered above preceded by the script name; for example, startappname.


    To view the man pages, you need to specify the path to the man page. For example, to view the startapp man pages, use the following command:


    % man -M /opt/NETapp/man startapp
    
  5. On one node of the cluster, configure the resources and start the application.


    # /opt/NETapp/util/startapp -h logichostname \
    -p port-and-protocol-list
    

    The arguments to the start script will vary according to the type of resource: failover or scalable. Check the customized man page or run the start script without any argument to get a usage statement.


    # /opt/NETapp/util/startapp
    The resource name of LogicalHostname or SharedAddress must be specified.
    
    For failover services: 
    Usage: startapp -h <logical host name>
          -p <port and protocol list>
          [-n <nafogroup/adapter list>]
          [-v] 
    
    For scalable services: 
    Usage: startapp 
          -h <shared address name>
          -p <port and protocol list>
          [-l <load balancing policy>] 
          [-n <nafogroup/adapter list>]
          [-w <load balancing weights>] [-v] 
    
    For stand-alone (non-network aware applications):
    Usage: startapp [-v]