Sun Cluster 3.0 U1 Data Services Installation and Configuration Guide

Adding Resources to Resource Groups

A resource is an instantiation of a resource type. You must add resources to a resource group before the RGM can manage the resources. This section describes the following three resource types.

Logical-hostname resources and shared-address resources are always added to failover resource groups. Data-service resources for failover data services are added to failover resource groups. Failover resource groups contain both the logical-hostname resources and the application resources for the data service. Scalable resource groups contain only the application resources for scalable services. The shared-address resources on which the scalable service depends must reside in a separate failover resource group. You must specify dependencies between the scalable application resources and the shared-address resources for the data service to scale across cluster nodes.

See the Sun Cluster 3.0 U1 Concepts document and Chapter 1, Planning for Sun Cluster Data Services for more information on resources.

How to Add a Logical-Hostname Resource to a Resource Group

To complete this procedure, you must supply the following information.

See the scrgadm(1M) man page for additional information.


Note -

Perform this procedure from any cluster node.


  1. Become superuser on a cluster member.

  2. Add the logical-hostname resource to the resource group.


    # scrgadm -a -L [-j resource] -g resource-group -l hostnamelist, ... [-n netiflist]
    -a

    Adds a logical-hostname resource.

    -L

    Specifies the logical-hostname resource form of the command.

    -j resource

    Specifies an optional resource name of your choice. If you do not specify this option, the name defaults to the first hostname specified with the -l option.

    -g resource-group

    Specifies the name of the resource group in which this resource resides.

    -l hostnamelist, ...

    Specifies a comma-separated list of UNIX hostnames (logical hostnames) by which clients communicate with services in the resource group.

    -n netiflist

    Specifies an optional comma-separated list that identifies the NAFO groups on each node. All nodes in nodelist of the resource group must be represented in netiflist. See the scrgadm(1M) man page for a description of the syntax for specifying netiflist. If you do not specify this option, scrgadm attempts to discover a net adapter on the subnet that the hostnamelist identifies for each node in nodelist.

  3. Verify that the logical-hostname resource has been added.


    # scrgadm -pv -j resource
    

    The resource addition action causes the Sun Cluster software to validate the resource. If the validation succeeds, the resource can be enabled, and the resource group can be moved into the state where the RGM manages it. If the validation fails, the scrgadm command produces an error message to that effect and exits. If the validation fails, check the syslog on each node for an error message. The message appears on the node that performed the validation, not necessarily the node on which you ran the scrgadm command.

Example - Adding a Logical-Hostname Resource to a Resource Group

This example shows the addition of logical-hostname resource (resource-1) to a resource group (resource-group-1).


# scrgadm -a -L -j resource-1 -g resource-group-1 -l schost-1
# scrgadm -pv -j resource-1
Res Group name: resource-group-1
(resource-group-1) Res name:                              resource-1
  (resource-group-1:resource-1) Res R_description:
  (resource-group-1:resource-1) Res resource type:        SUNW.LogicalHostname
  (resource-group-1:resource-1) Res resource group name:  resource-group-1
  (resource-group-1:resource-1) Res enabled:              False
  (resource-group-1:resource-1) Res monitor enabled:      True

Where to Go From Here

After adding logical-hostname resources, use the procedure "How to Bring a Resource Group Online" to bring them online.

How to Add a Shared-Address Resource to a Resource Group

To complete this procedure, you must supply the following information.

See the scrgadm(1M) man page for additional information.


Note -

Perform this procedure from any cluster node.


  1. Become superuser on a cluster member.

  2. Add the shared-address resource to the resource group.


    # scrgadm -a -S [-j resource] -g resource-group -l hostnamelist, ... \
    [-X auxnodelist] [-n netiflist]
    -a

    Adds shared-address resources.

    -S

    Specifies the shared-address resource form of the command.

    -j resource

    Specifies an optional resource name of your choice. If you do not specify this option, the name defaults to the first hostname specified with the -l option.

    -g resource-group

    Specifies the resource-group name.

    -l hostnamelist, ...

    Specifies a comma-separated list of shared address hostnames.

    -X auxnodelist

    Specifies a comma-separated list of physical node names or IDs that identify the cluster nodes that can host the shared address but never serve as primary in the case of failover. These nodes are mutually exclusive, with the nodes identified in the resource group nodelist as potential masters.

    -n netiflist

    Specifies an optional comma-separated list that identifies the NAFO groups on each node. All the nodes in nodelist of the resource group must be represented in the netiflist. See the scrgadm(1M) man page for a description of the syntax for specifying netiflist. If you do not specify this option, scrgadm attempts to discover a net adapter on the subnet that the hostnamelist identifies for each node in nodelist.

  3. Verify that the shared-address resource has been added and validated.


    # scrgadm -pv -j resource
    

    The resource addition action causes the Sun Cluster software to validate the resource. If the resource is successfully validated, the resource can be enabled, and the resource group can be moved into the state where the RGM manages it. If the validation fails, the scrgadm command produces an error message to this effect and exits. If the validation fails, check the syslog on each node for an error message. The message appears on the node that performed the validation, not necessarily the node on which you ran the scrgadm command.

Example - Adding a Shared-Address Resource to a Resource Group

This example shows the addition of a shared-address resource (resource-1) to a resource group (resource-group-1).


# scrgadm -a -S -j resource-1 -g resource-group-1 -l schost-1
# scrgadm -pv -j resource-1
(resource-group-1) Res name:                                resource-1
    (resource-group-1:resource-1) Res R_description:
    (resource-group-1:resource-1) Res resource type:        SUNW.SharedAddress
    (resource-group-1:resource-1) Res resource group name:  resource-group-1
    (resource-group-1:resource-1) Res enabled:              False
    (resource-group-1:resource-1) Res monitor enabled:      True

Where to Go From Here

After adding a shared resource, use the procedure "How to Bring a Resource Group Online" to enable the resource.

How to Add a Failover Application Resource to a Resource Group

A failover application resource is an application resource that uses logical hostnames created in a failover resource group previously.

To complete this procedure, you must supply the following information.

See the scrgadm(1M) man page for additional information.


Note -

Perform this procedure from any cluster node.


  1. Become superuser on a cluster member.

  2. Add a failover application resource to the resource group.


    # scrgadm -a -j resource -g resource-group -t resource-type \
    [-x Extension_property=value, ...] [-y Standard_property=value, ...]
    -a

    Adds a resource.

    -j resource

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

    -g resource-group

    Specifies the name of the failover resource group created previously.

    -t resource-type

    Specifies the name of the resource type for the resource.

    -x Extension_property=value, ...

    Specifies a comma-separated list of extension properties that depend on the particular data service. See the chapter for each data service to determine whether the data service requires this property.

    -y Standard_property=value, ...

    Specifies a comma-separated list of standard properties that depends on the particular data service. See the chapter for each data service and Appendix A, Standard Properties to determine whether the data service requires this property.


    Note -

    You can set additional properties. See Appendix A, Standard Properties and the chapter in this book on how to install and configure your failover data service for details.


  3. Verify that the failover application resource has been added and validated.


    # scrgadm -pv -j resource
    

    The resource addition action causes the Sun Cluster software to validate the resource. If the validation succeeds, the resource can be enabled, and the resource group can be moved into the state where the RGM manages it. If the validation fails, check the syslog on each node for an error message. The message appears on the node that performed the validation, not necessarily the node on which you ran the scrgadm command.

Example - Adding a Failover Application Resource to a Resource Group

This example shows the addition of a resource (resource-1) to a resource group (resource-group-1). The resource depends on logical-hostname resources (schost-1, schost-2), which must reside in the same failover resource groups that you defined previously.


# scrgadm -a -j resource-1 -g resource-group-1 -t resource-type-1 \
-y Network_resources_used=schost-1,schost2 \
# scrgadm -pv -j resource-1
(resource-group-1) Res name:                                resource-1
    (resource-group-1:resource-1) Res R_description:
    (resource-group-1:resource-1) Res resource type:        resource-type-1
    (resource-group-1:resource-1) Res resource group name:  resource-group-1
    (resource-group-1:resource-1) Res enabled:              False
    (resource-group-1:resource-1) Res monitor enabled:      True

Where to Go From Here

After adding a failover application resource, use the procedure "How to Bring a Resource Group Online" to enable the resource.

How to Add a Scalable Application Resource to a Resource Group

A scalable application resource is an application resource that uses shared addresses in a failover resource group.

To complete this procedure, you must supply the following information:

See the scrgadm(1M) man page for additional information.


Note -

Perform this procedure from any cluster node.


  1. Become superuser on a cluster member.

  2. Add a scalable application resource to the resource group.


    # scrgadm -a -j resource -g resource-group -t resource-type \
    -y Network_resources_used=network-resource[,network-resource...] \
    -y Scalable=True
    [-x Extension_property=value, ...] [-y Standard_property=value, ...]
    -a

    Adds a resource.

    -j resource

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

    -g resource-group

    Specifies the name of a scalable service resource group created previously.

    -t resource-type

    Specifies the name of the resource type for this resource.

    -y Network_resources_used= network-resource[,network-resource...]

    Specifies the list of network resources (shared addresses) on which this resource depends.

    -y Scalable=True

    Specifies that this resource is scalable.

    -x Extension_property=value, ...

    Specifies a comma-separated list of extension properties that depend on the particular data service. See the chapter for each data service to determine whether the data service requires this property.

    -y Standard_property=value, ...

    Specifies a comma-separated list of standard properties that depends on the particular data service. See the chapter for each data service and Appendix A, Standard Properties to determine whether the data service requires this property.


    Note -

    You can set additional properties. See Appendix A, Standard Properties and the chapter in this book on how to install and configure your scalable data service for information on other configurable properties. Specifically for scalable services, you typically set the Port_list, Load_balancing_weights, and Load_balancing_policy properties, which Appendix A, Standard Properties describes.


  3. Verify that the scalable application resource has been added and validated.


    # scrgadm -pv -j resource
    

    The resource addition action causes the Sun Cluster software to validate the resource. If the validation succeeds, the resource can be enabled and the resource group can be moved into the state where the RGM manages it. If the validation fails, check the syslog on each node for an error message. The message appears on the node that performed the validation, not necessarily the node on which you ran the scrgadm command.

Example - Adding a Scalable Application Resource to a Resource Group

This example shows the addition of a resource (resource-1) to a resource group (resource-group-1). Note that resource-group-1 depends on the failover resource group that contains the network addresses being used (schost-1 and schost-2 in the following example). The resource depends on shared-address resources (schost-1, schost-2), which must reside in one or more failover resource groups that you defined previously.


# scrgadm -a -j resource-1 -g resource-group-1 -t resource-type-1 \
-y Network_resources_used=schost-1,schost-2 \
-y Scalable=True
# scrgadm -pv -j resource-1
(resource-group-1) Res name:                                resource-1
    (resource-group-1:resource-1) Res R_description:
    (resource-group-1:resource-1) Res resource type:        resource-type-1
    (resource-group-1:resource-1) Res resource group name:  resource-group-1
    (resource-group-1:resource-1) Res enabled:              False
    (resource-group-1:resource-1) Res monitor enabled:      True

Where to Go From Here

After you add a scalable application resource, follow the procedure "How to Bring a Resource Group Online" to enable the resource.