Sun Cluster 3.0 Data Services Installation and Configuration Guide

Creating a Resource Group

A resource group contains a set of resources, all of which are brought online or offline together on a given node or set of nodes. You must create an empty resource group before placing resources into it.

The two resource group types are: failover and scalable. A failover resource group can be online on one node only at any time; a scalable resource group can be online on multiple nodes simultaneously.

You can create resource groups through the Sun Management Center GUI or by using the command line as shown in the following procedure. For conceptual information on resource groups, see Chapter 1, Planning for Sun Cluster Data Services and the Sun Cluster 3.0 Concepts document.

How to Create a Failover Resource Group

A failover resource group contains network addresses, such as the built-in resource types LogicalHostname and SharedAddress; as well as failover resources, such as the data service application resources for a failover data service. The network resources, along with their dependent data service resources, move between cluster nodes when data services fail over or are switched over.

Refer to scrgadm(1M) for additional information.

Perform this procedure from any cluster node.

  1. Become superuser on a node in the cluster.

  2. Create the failover resource group.


    # scrgadm -a -g resource-group-name [-h nodelist]
    -a

    Adds the specified resource group.

    -g resource-group-name

    Specifies your choice of the name of the failover resource group to add. This name must begin with an ASCII character.

    -h nodelist

    Specifies an optional ordered list of nodes that can master this resource group. If you do not specify this list, it defaults to all the nodes in the cluster.

  3. Verify that the resource group has been created.


    # scrgadm -pv -g resource-group-name
    

Example-Creating a Failover Resource Group

This example shows the addition of a failover resource group (lh-rg-1) that can be mastered by two nodes (phys-schost-1 and phys-schost-2).


# scrgadm -a -g lh-rg-1 -h phys-schost1,phys-schost-2
# scrgadm -pv -g lh-rg-1
Res Group name:                                 lh-rg-1
  (lh-rg-1) Res Group RG_description:           <NULL>
  (lh-rg-1) Res Group management state:         Unmanaged
  (lh-rg-1) Res Group Failback:                 False
  (lh-rg-1) Res Group Nodelist:                 phys-schost-1 phys-schost-2
  (lh-rg-1) Res Group Maximum_primaries:        1
  (lh-rg-1) Res Group Desired_primaries:        1
  (lh-rg-1) Res Group RG_dependencies:          <NULL>
  (lh-rg-1) Res Group mode:                     Failover
  (lh-rg-1) Res Group network dependencies:     True
  (lh-rg-1) Res Group Global_resources_used:    All
  (lh-rg-1) Res Group Pathprefix:

Where to Go from Here

After creating a failover resource group, you can add application resources to this resource group. For the procedure, see "Adding Resources to Resource Groups".

How to Create a Scalable Resource Group

A scalable resource group is used with scalable services. The shared address feature is the Sun Cluster networking facility that allows the multiple instances of a scalable service to appear as a single service. You must first create a failover resource group that contains the shared addresses on which the scalable resources depend. Next, create a scalable resource group and add scalable resources to that group.

Refer to scrgadm(1M) for additional information.

Perform this procedure from any cluster node.

  1. Become superuser on a node in the cluster.

  2. Create the failover resource group that holds the shared addresses to be used by the scalable resource.

  3. Create the scalable resource group.


    # scrgadm -a -g ss-resource-group \
    -y Maximum_primaries=m \
    -y Desired_primaries=n \
    -y RG_dependencies=depend-resource-group \
    -h nodelist]
    -a

    Adds a scalable resource group.

    -g ss-resource-group-name

    Specifies your choice of the name of the scalable resource group to add.

    -y Maximum_primaries=m

    Specifies the maximum number of active primaries for this resource group.

    -y Desired_primaries=n

    Specifies the number of active primaries on which the resource group should attempt to start.

    -y RG_dependencies=depend-resource-group

    Identifies the resource group that contains the shared address resource on which the resource group being created depends.

    -h nodelist

    Specifies an optional list of nodes on which this resource group is to be available. If you do not specify this list, it defaults to all nodes.

  4. Verify that the scalable resource group has been created.


    # scrgadm -pv -g resource-group-name
    

Example-Creating a Scalable Resource Group

This example shows the addition of a scalable resource group (ss-rg-1) to be hosted on two nodes (phys-schost-1, phys-schost-2). The scalable resource group depends on the failover resource group (fo-rg-1) that contains the shared addresses.


# scrgadm -a -g ss-rg-1 \
-y Maximum_primaries=2 \
-y Desired_primaries=2 \
-y RG_dependencies=fo-rg-1 \
-h phys-schost-1,phys-schost-2
# scrgadm -pv -g ss-rg-1
Res Group name:                                 ss-rg-1
  (ss-rg-1) Res Group RG_description:           <NULL>
  (ss-rg-1) Res Group management state:         Unmanaged
  (ss-rg-1) Res Group Failback:                 False
  (ss-rg-1) Res Group Nodelist:                 phys-schost-1 phys-schost-2
  (ss-rg-1) Res Group Maximum_primaries:        2
  (ss-rg-1) Res Group Desired_primaries:        2
  (ss-rg-1) Res Group RG_dependencies:          fo-rg-1
  (ss-rg-1) Res Group mode:                     Scalable
  (ss-rg-1) Res Group network dependencies:     True
  (ss-rg-1) Res Group Global_resources_used:    All
  (ss-rg-1) Res Group Pathprefix:

Where to Go from Here

After a scalable resource group has been created, you can add scalable application resources to the resource group. See "How to Add a Scalable Application Resource to a Resource Group" for details.