Sun Cluster Data Services Developer's Guide for Solaris OS

Setting Up the Development Environment for Writing a Data Service

Before you begin to develop your data service, you must install the Sun Cluster development package (SUNWscdev) to have access to the Sun Cluster header and library files. Although this package is already installed on all cluster nodes, you typically develop your data service on a separate, non-cluster development machine, not on a cluster node. In this typical case, you must use the pkgadd command to install the SUNWscdev package on your development machine.

When compiling and linking your code, you must set particular options to identify the header and library files.


Note –

You cannot mix compatibility-mode compiled C++ code and standard-mode compiled C++ code in the Solaris Operating System and Sun Cluster products. Consequently, if you intend to create a C++ based data service for use on Sun Cluster, you must compile that data service, as follows:


When you have finished development (on a non-cluster node), you can transfer the completed data service to a cluster for testing.


Note –

Ensure that you are using the Developer or Entire Distribution software group of the Solaris 8 OS or a later version of the Solaris OS.


The procedures in this section describe how to complete the following tasks:

ProcedureHow to Set Up the Development Environment

This procedure describes how to install the SUNWscdev package and set the compiler and linker options for data service development.

Steps
  1. Become superuser or assume an equivalent role.

  2. Change directory to the CD-ROM directory that you want.


    # cd cd-rom-directory
    
  3. Install the SUNWscdev package in the current directory.

    • For the Solaris 10 OS in a zones environment, as global administrator in the global zone, type the following command:


      # pkgadd -G -d . SUNWscdev
      

      The SUNWscdev package is added to the global zone, provided that the contents of SUNWscdev do not affect any area of the global zone that is shared with a non-global zone.

    • For any other version of the Solaris OS or the Solaris 10 OS in a non-zones environment, type the following command:


      # pkgadd -d . SUNWscdev
      
  4. In the makefile, specify compiler and linker options that identify the include and library files for your data service code.

    Specify the -I option to identify the Sun Cluster header files, the -L option to specify the compile-time library search path on the development system, and the -R option to specify the library search path to the runtime linker in the cluster.

    # Makefile for sample data service
    ...
    
    -I /usr/cluster/include
    
    -L /usr/cluster/lib
    
    -R /usr/cluster/lib
    ...

Transferring a Data Service to a Cluster

When you have completed the data service on a development machine, you must transfer the data service to a cluster for testing. To reduce the chance of error during the transfer, combine the data service code and the RTR file into a package, and install the package on all nodes of the cluster.


Note –

Whether you use pkgadd or some other way to install the data service, you must put the data service on all cluster nodes. Note that Agent Builder creates this package automatically.