Sun Cluster 3.0 Data Services Installation and Configuration Guide

Chapter 9 Administering Data Service Resources

This chapter describes the procedures used to manage resources, resource groups, and resource types within the cluster. If a procedure can be completed through the Sun Management Center GUI, that is noted before the procedure.

This chapter contains the following procedures:

For overview information about resource types, resource groups, and resources, see Chapter 1, Planning for Sun Cluster Data Services and the Sun Cluster 3.0 Concepts document.

Administering Data Service Resources

Table 9-1 lists the sections that describe the administration tasks for data service resources.

Table 9-1 Task Map: Data Service Administration

Task 

For Instructions, Go To ... 

Register a resource type. 

"How to Register a Resource Type"

Create failover or scalable resource groups. 

"How to Create a Failover Resource Group"

 

"How to Create a Scalable Resource Group"

Add logical host names or shared addresses and data service resources to resource groups. 

"How to Add a Logical Host Name Resource to a Resource Group"

 

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

 

"How to Add a Failover Application Resource to a Resource Group"

 

"How to Add a Scalable Application Resource to a Resource Group"

Enable resources and resource monitors, manage the resource group, and bring it and its associated resources online. 

"How to Bring a Resource Group Online"

Remove resource types from the cluster. 

"How to Remove a Resource Type"

Remove resource groups from the cluster. 

"How to Remove a Resource Group"

Remove resources from resource groups. 

"How to Remove a Resource"

Switch the primary for a resource group. 

"How to Switch the Current Primary of a Resource Group"

Disable resources and move their resource group into the unmanaged state. 

"How to Disable a Resource and Move Its Resource Group into the Unmanaged State"

Display resource type, resource group, and resource configuration information. 

"How to Display Resource Type, Resource Group, and Resource Configuration Information"

Change resource type, resource group, and resource properties. 

"How to Change Resource Type Properties"

"How to Change Resource Group Properties"

"How to Change Resource Properties"

Clear error flags for failed Resource Group Manager (RGM) processes. 

"How to Clear the STOP_FAILED Error Flag on Resources"

Re-register the built-in resource types LogicalHostname and SharedAddress

"How to Re-register Preregistered Resource Types"

Update the network interface list for the network resources and update the node list for the resource group. 

"How to Add a Node to a Resource Group"

Remove a node from a resource group. 

"How to Remove a Node from a Resource Group"

Set up SUNW.HAStorage for resource groups so as to synchronize the startups between those resource groups and disk device groups.

"How to Set Up SUNW.HAStorage Resource Type for New Resources"

Configuring and Administering Sun Cluster Data Services

Configuring a Sun Cluster data service is a single task composed of several procedures. These procedures enable you to register a resource type, create resource groups, add resources into the resource groups, and bring the resources online.

You can use the Sun Management Center GUI or the command-line interface to initially configure Sun Cluster data services. For information on using the GUI to configure data services, refer to the Sun Cluster 3.0 System Administration Guide. The command-line interface is described in the installation and configuration chapter for each data service in this document.

To update your data service configuration after the initial configuration, use the procedures in this chapter or the Sun Management Center GUI.

Registering a Resource Type

A resource type provides specification of common properties and callback methods that apply to all the resources of the given type. You must register a resource type before creating a resource of that type. For more information on resource types, see Chapter 1, Planning for Sun Cluster Data Services.

How to Register a Resource Type

To complete this procedure, you must supply the name for the resource type you are registering, which is an abbreviation for the data service name. This name maps to the name shown on your data service license certificate. For the mapping between the names and the license certificate names, see the Sun Cluster 3.0 Release Notes.

Perform this procedure from any cluster node.

Refer to scrgadm(1M) for additional information.

  1. Become superuser on a node in the cluster.

  2. Register the resource type.


    # scrgadm -a -t resource-type-name
    
    -a

    Adds the specified resource type.

    -t resource-type-name

    Specifies name of the resource type to add. To determine the predefined name to supply, see the Sun Cluster 3.0 Release Notes.

  3. Verify that the resource type has been registered.


    # scrgadm -pv -t resource-type-name
    

Example-Registering Resource Types

The following example registers Sun Cluster HA for iPlanet Web Server (internal name iws).


# scrgadm -a -t SUNW.iws
# scrgadm -pv -t SUNW.iws
Res Type name:                                   SUNW.iws
  (SUNW.iws) Res Type description:               None registered
  (SUNW.iws) Res Type base directory:            /opt/SUNWschtt/bin
  (SUNW.iws) Res Type single instance:           False
  (SUNW.iws) Res Type init nodes:                All potential masters
  (SUNW.iws) Res Type failover:                  False
  (SUNW.iws) Res Type version:                   1.0
  (SUNW.iws) Res Type API version:               2
  (SUNW.iws) Res Type installed on nodes:        All
  (SUNW.iws) Res Type packages:                  SUNWschtt

Where to Go from Here

After registering resource types, you can create resource groups and add resources to the resource group. For details, see the following section, "Creating a Resource Group".

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.

Adding Resources to Resource Groups

A resource is an instantiation of a resource type. You must add resources to a resource group before they can be managed by the RGM. Three types of resources are described in this section: logical host name resources or shared address resources and data service (application) resources.

Logical host name 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 host name resources and the application resources for the data service. Scalable resource groups contain only the application resources for scalable services. The shared addresses 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.

You can add resources to resource groups through the Sun Management Center GUI or by using the command line, as shown in this section.

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

How to Add a Logical Host Name Resource to a Resource Group

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

Refer to scrgadm(1M) for additional information.

Perform this procedure from any cluster node.

  1. Become superuser on a node in the cluster.

  2. Add the logical host name resource to the resource group.


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

    Adds a logical host name resource.

    -L

    Specifies the logical host name resource form of the command.

    -j resource-name

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

    -g resource-group-name

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

    -l hostname, ...

    Specifies a comma-separated list of UNIX host names (logical host names) 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 scrgadm(1M) 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 identified by the hostname list for each node in nodelist.

  3. Verify that the logical host name resource has been added.


    # scrgadm -pv -j resource-name
    

    The resource addition action cause the resource to be validated by the Sun Cluster software. If the validation succeeds, the resource can be enabled and the resource group can be moved into the state where it is managed by the RGM. If the validation fails, scrgadm produces an error message to that effect and exits. In that case, 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 Host Name Resource to a Resource Group

This example shows the addition of logical host name resource (lh-r-1) to a resource group (lh-rg-1).


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

Where to Go from Here

After adding logical host name 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:

Refer to scrgadm(1M) for additional information.

Perform this procedure from any cluster node.

  1. Become superuser on a node in the cluster.

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


    # scrgadm -a -S [-j resource-name] -g resource-group-name -l hostname, ... \
    [-X auxnode-list] [-n netiflist]
    -a

    Adds shared address resources.

    -S

    Specifies the shared address resource form of the command.

    -j resource-name

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

    -g resource-group-name

    Specifies the resource group name.

    -l hostname, ...

    Specifies a comma-separated list of shared address host names.

    -X auxnode-list

    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 network-interface-list. See scrgadm(1M) 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 identified by the hostname list for each node in nodelist.

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


    # scrgadm -pv -j resource-name
    

    The resource addition action causes the resource to be validated by the Sun Cluster software. If the resource is successfully validated, it can be enabled and the resource group can be moved into the state where it is managed by the RGM. If the validation fails, scrgadm produces an error message to this effect and exits. In that case, 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 (sa-r-1) to a resource group (sa-rg-1).


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

Where to Go from Here

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

How to Add a Failover Application Resource to a Resource Group

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

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

Refer to scrgadm(1M) for additional information.

Perform this procedure from any cluster node.

  1. Become superuser on a node in the cluster.

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


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

    Adds a resource.

    -j resource-name

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

    -g resource-group-name

    Specifies the name of the failover resource group created previously.

    -t resource-type-name

    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 it is required.

    -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 it is required.


    Note -

    You can set additional properties. For details, see Appendix A, Standard Properties and the chapter in this book on installing and configuring your failover data service.


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


    # scrgadm -pv -j resource-name
    

    The resource addition action causes the resource to be validated by the Sun Cluster software. If the validation succeeds, the resource can be enabled and the resource group can be moved into the state where it is managed by the RGM. 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 (fo-r-1) to a resource group (fo-rg-1). The resource depends on logical host name resources (schost-1, schost-2), which must reside in the same failover resource groups defined previously.


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

Where to Go from Here

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

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:

Refer to scrgadm(1M) for additional information.

Perform this procedure from any cluster node.

  1. Become superuser on a node in the cluster.

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


    # scrgadm -a -j resource-name -g resource-group-name -t resource-type-name \
    -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-name

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

    -g resource-group-name

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

    -t resource-type-name

    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 it is required.

    -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 it is required.


    Note -

    You can set additional properties. For information on other configurable properties, see Appendix A, Standard Properties and the chapter in this book on installing and configuring your scalable data service. Specifically for scalable services, you would normally set the Port_list, Load_balancing_weights, and Load_balancing_policy properties, which are described in Appendix A, Standard Properties.


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


    # scrgadm -pv -j resource-name
    

    The resource addition action causes the resource to be validated by the Sun Cluster software. If the validation succeeds, the resource can be enabled and the resource group can be moved into the state where it is managed by the RGM. 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 (ss-r-1) to a resource group (ss-rg-1). Note that ss-rg-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 defined previously.


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

Where to Go from Here

After adding a scalable application resource, enable it by following the procedure "How to Bring a Resource Group Online".

Bringing Resource Groups Online

To allow resources to begin providing HA services, you must enable the resources in the resource group, enable the resource monitors, make the resource group managed, and bring the resource group online. You can perform these tasks individually or by using the one-step procedure below. For details, see scswitch(1M).

Perform this procedure from any cluster node.

How to Bring a Resource Group Online

  1. Become superuser on a node in the cluster.

  2. Enable the resource and bring the resource group online.

    If the resource monitor has been previously disabled, it will be enabled also.


    # scswitch -Z -g resource-group-name
    
    -Z

    Brings a resource group online by first enabling its resources and their monitors.

    -g resource-group-name

    Specifies the name of the resource group to bring online. The group must be an existing resource group.

  3. Verify that the resource is online.

    Run the following command on any cluster node and look for the Resource Group State field to see if it is online on the nodes specified in the node list.


    # scstat -g
    

Example-Bring a Resource Group Online

This example shows how to bring a resource group (rg-1) online and verify its status.


# scswitch -Z -g rg-1
# scstat -g

Where to Go from Here

After a resource group has been brought online, it is configured and ready to use. In the event of resource or node failure, the RGM maintains availability of the resource group by automatically switching the resource group online on alternate nodes.

Removing Resource Types

You need not remove resource types that are not being used. However, if you want to remove a resource type, you can use this procedure to do so.

For additional information, see scrgadm(1M) and scswitch(1M).

Perform this procedure from any cluster node.

How to Remove a Resource Type

Before removing a resource type, you must disable and remove all the resources of that type in all the resource groups in the cluster. Use the scrgadm -pv command to identify the resources and resource groups in the cluster.

  1. Become superuser on a node in the cluster.

  2. Disable each resource of the resource type to be removed.


    # scswitch -n -j resource-name
    
    -n

    Disables the resource.

    -j resource-name

    Specifies the name of the resource to disable.

  3. Remove each resource of the resource type to be removed.


    # scrgadm -r -j resource-name
    
    -r

    Removes the specified resource.

    -j

    Specifies the name of the resource to remove.

  4. Remove the resource type.


    # scrgadm -r -t resource-type-name
    
    -r

    Removes the specified resource type.

    -t resource-type-name

    Specifies the name of the resource type to remove.

  5. Verify that the resource type has been removed.


    # scrgadm -p
    

Example-Removing a Resource Type

This example shows how to disable and remove all resources of a resource type (resource-type-1) and then remove the resource type itself. Here, resource-1 is a resource of the resource type resource-type-1.


# scswitch -n -j resource-1
# scrgadm -r -j resource-1
# scrgadm -r -t resource-type-1

Removing Resource Groups

To remove a resource group, you must first remove all the resources from the resource group.

Perform this procedure from any cluster node.

For additional information, see scrgadm(1M) and scswitch(1M).

How to Remove a Resource Group

  1. Become superuser on a node in the cluster.

  2. Run the following command to take the resource group offline.


    # scswitch -F -g resource-group-name
    
    -F

    Switches a resource group offline.

    -g resource-group-name

    Specifies the name of the resource group to take offline.

  3. Disable all the resources that are part of the resource group.

    You can use the scrgadm -pv command to view the resources in the resource group. Disable all the resources in the resource group to be removed.


    # scswitch -n -j resource-name
    
    -n

    Disables the resource.

    -j resource-name

    Specifies the name of the resource to disable.

    If any dependent data service resources exist in a resource group, you cannot disable the resource until you have disabled all the resources that depend on it.

  4. Remove all resources from the resource group.

    Use the following scrgadm commands to:

    • Remove the resources

    • Remove the resource group


    # scrgadm -r -j resource-name
    # scrgadm -r -g resource-group-name
    
    -r

    Removes the specified resource or resource group.

    -j resource-name

    Specifies the name of the resource to be removed.

    -g resource-group-name

    Specifies the name of the resource group to be removed.

  5. Verify that the resource group has been removed.


    # scrgadm -p
    

Example-Removing a Resource Group

This example shows how to remove a resource group (rg-1) after you have removed its resource (resource-1).


# scswitch -F -g rg-1
# scrgadm -r -j resource-1
# scrgadm -r -g rg-1

Removing Resources

Disable the resource before removing it from a resource group.

For additional information, see scrgadm(1M) and scswitch(1M).

Perform this procedure from any cluster node.

How to Remove a Resource

  1. Become superuser on a node in the cluster.

  2. Disable the resource for the resource that you want to remove.


    # scswitch -n -j resource-name
    
    -n

    Disables the resource.

    -j resource-name

    Specifies the name of the resource to disable.

  3. Remove the resource.


    # scrgadm -r -j resource-name
    
    -r

    Removes the specified resource.

    -j resource-name

    Specifies the name of the resource to remove.

  4. Verify that the resource has been removed.


    # scrgadm -p
    

Example-Removing a Resource

This example shows how to disable and remove a resource (resource-1).


# scswitch -n -j resource-1
# scrgadm -r -j resource-1

Switching the Current Primary of a Resource Group

Use the following procedure to switch over a resource group from its current primary to another node that will become the new primary.

For additional information, see scrgadm(1M) and scswitch(1M).

Perform this procedure from any cluster node.

How to Switch the Current Primary of a Resource Group

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

  1. Become superuser on a node in the cluster.

  2. Switch the primary to a potential primary.


    # scswitch -z -g resource-group-name -h nodelist
    
    -z

    Switches the specified resource group online.

    -g resource-group-name

    Specifies the name of the resource group to switch.

    -h nodelist

    Specifies the node or nodes on which the resource group is to be brought online or is to remain online. This resource group is then switched to be offline on all other nodes.

  3. Verify that the resource group has been switched to the new primary.

    Run the following command and look for the output for the state of the resource group that has been switched over.


    # scstat -g
    

Example-Switching the Resource Group to a New Primary

This example shows how to switch a resource group (rg-1) from its current primary (phys-schost-1) to the potential primary (phys-schost-2). You first verify that the resource group is online on phys-schost-1, perform the switch, then verify that the group is switched to be online on phys-schost-2.


phys-schost-1# scstat -g
...
Resource Group Name:          rg-1
  Status                                           
    Node Name:                phys-schost-1
    Status:                   Online

    Node Name:                phys-schost-2
    Status:                   Offline
...
phys-schost-1# scswitch -z -g rg-1 -h phys-schost-2
phys-schost-1# scstat -g
...
Resource Group Name:          rg-1
  Status                                           
    Node Name:                phys-schost-2
    Status:                   Online

    Node Name:                phys-schost-1
    Status:                   Offline
...

Disabling Resources and Moving Their Resource Group Into the Unmanaged State

At times, you must bring a resource group into the unmanaged state before performing an administrative procedure on it. Before moving a resource group into the unmanaged state, you must disable all the resources that are part of the resource group and bring the resource group offline.

For additional information, see scrgadm(1M) and scswitch(1M).

Perform this procedure from any cluster node.

How to Disable a Resource and Move Its Resource Group into the Unmanaged State

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

To determine the resource and resource group names that are needed for this procedure, use the scrgadm -pv command.

  1. Become superuser on a node in the cluster.

  2. Disable the resource.

    Repeat this step for all resources in the resource group.


    # scswitch -n -j resource-name
    
    -n

    Disables the resource.

    -j resource-name

    Specifies the name of the resource to disable.

  3. Run the following command to take the resource group offline.


    # scswitch -F -g resource-group-name
    
    -F

    Switches a resource group offline.

    -g resource-group-name

    Specifies the name of the resource group to take offline.

  4. Bring the resource group into the unmanaged state.


    # scswitch -u -g resource-group-name
    
    -u

    Puts the specified resource group in the unmanaged state.

    -g resource-group-name

    Specifies the name of the resource group to move into the unmanaged state.

  5. Verify that the resources are disabled and the resource group is in the unmanaged state.


    # scrgadm -pv -g resource-group-name
    

Example-Disabling a Resource and Moving the Resource Group Into the Unmanaged State

This example shows how to disable the resource (r-1) and then move the resource group (rg-1) into the unmanaged state.


# scswitch -n -j r-1
# scswitch -F -g rg-1
# scswitch -u -g rg-1
# scrgadm -pv -g rg-1
Res Group name:                              rg-1
  (rg-1) Res Group RG_description:           <NULL>
  (rg-1) Res Group management state:         Unmanaged
  (rg-1) Res Group Failback:                 False
  (rg-1) Res Group Nodelist:                 phys-schost-1 phys-schost-2
  (rg-1) Res Group Maximum_primaries:        2
  (rg-1) Res Group Desired_primaries:        2
  (rg-1) Res Group RG_dependencies:          <NULL>
  (rg-1) Res Group mode:                     Failover
  (rg-1) Res Group network dependencies:     True
  (rg-1) Res Group Global_resources_used:    All
  (rg-1) Res Group Pathprefix:
 
  (rg-1) Res name:                           r-1
    (rg-1:r-1) Res R_description:
    (rg-1:r-1) Res resource type:            SUNW.apache
    (rg-1:r-1) Res resource group name:      rg-1
    (rg-1:r-1) Res enabled:                  True
    (rg-1:r-1) Res monitor enabled:          False
    (rg-1:r-1) Res detached:                 False

Displaying Resource Type, Resource Group, and Resource Configuration Information

Before performing administrative procedures on resources, resource groups, or resource types, use this procedure to view the current configuration settings for these objects.

You can display resource type, resource group, and resource configuration information through the Sun Management Center GUI or by using the command line as shown in this section.

For additional information, see scrgadm(1M) and scswitch(1M).

Perform this procedure from any cluster node.

How to Display Resource Type, Resource Group, and Resource Configuration Information

The scrgadm command provides three levels of configuration status information, as follows:

You can also view specific resource types, resource groups, and resources by using the -t, -g, and -j (resource type, resource group, and resource, respectively) options, followed by the name of the object you want to view. For example, the following command specifies that you want to view specific information on the resource apache-1 only.


# scrgadm -p[v[v]] -j apache-1

For details, see the scrgadm(1M) man page.

Changing Resource Type, Resource Group, and Resource Properties

Resource groups and resources have standard configuration properties you can change. Resources also have extension properties, some of which are predefined by the data service developer, which you cannot change. See the individual data service chapters in this document for a list of the extension properties for each data service.

For information on the standard configuration properties for resource groups and resources, see scrgadm(1M).

You can change resource group and resource properties through the Sun Management Center GUI or by using the command line, as shown in this section. For the set of properties you can change through the GUI, see the Sun Management Center online help.

How to Change Resource Type Properties

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

Perform this procedure from any cluster node.

  1. Become superuser on a node in the cluster.

  2. Use the scrgadm command to determine the name of the resource type needed for this procedure.


    # scrgadm -pv
    
  3. Change the resource type property.

    The only property that can be changed for a resource type is Installed_node_list.


    # scrgadm -c -t resource-type-name -h installed-node-list
    
    -c

    Changes the specified resource type property.

    -t resource-type-name

    Specifies the name of the resource type.

    -h installed-node-list

    Specifies the names of nodes on which this resource type is installed.

  4. Verify that the resource type property has been changed.


    # scrgadm -pv -t resource-type-name
    

Example-Changing a Resource Type Property

This example shows how to change the SUNW.apache property to define that this resource type is installed on two nodes (phys-schost-1 and phys-schost-2).


# scrgadm -c -t SUNW.apache -h phys-schost-1,phys-schost-2 
# scrgadm -pv -t SUNW.apache
Res Type name:                               SUNW.apache
  (SUNW.apache) Res Type description:        Apache Resource Type
  (SUNW.apache) Res Type base directory:     /opt/SUNWscapc/bin
  (SUNW.apache) Res Type single instance:    False
  (SUNW.apache) Res Type init nodes:         All potential masters
  (SUNW.apache) Res Type failover:           False
  (SUNW.apache) Res Type version:            1.0
  (SUNW.apache) Res Type API version:        2
  (SUNW.apache) Res Type installed on nodes: phys-schost1 phys-schost-2
  (SUNW.apache) Res Type packages:           SUNWscapc

How to Change Resource Group Properties

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

This procedure describes the steps for changing resource group properties. For a complete list of resource group properties, see Appendix A, Standard Properties.

Perform this procedure from any cluster node.

  1. Become superuser on a node in the cluster.

  2. Change the resource group property.


    # scrgadm -c -g resource-group-name -y property=new-value
    
    -c

    Changes the specified property.

    -g resource-group-name

    Specifies the name of the resource group.

    -y property

    Specifies the name of the property to change.

  3. Verify that the resource group property has been changed.


    # scrgadm -pv -g resource-group-name
    

Example-Changing a Resource Group Property

This example shows how to change the Failback property for the resource group (ss-rg-1).


# scrgadm -c -g ss-rg-1 -y Failback=True
# scrgadm -pv -g ss-rg-1

How to Change Resource Properties

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

This procedure describes the steps for changing resource properties. For a complete list of resource group properties, see Appendix A, Standard Properties.

Perform this procedure from any cluster node.

  1. Become superuser on a node in the cluster.

  2. Use the scrgadm -pvv command to view the current resource property settings.


    # scrgadm -pvv -j resource-name
    
  3. Change the resource property.


    # scrgadm -c -j resource-name -y property=new-value | -x extension-property=new-value
    
    -c

    Changes the specified property.

    -j resource-name

    Specifies the name of the resource.

    -y property=new-value

    Specifies the name of the standard property to change.

    -x extension-property=new-value

    Specifies the name of the extension property to change. For Sun-supplied data services, see the extension properties documented in the chapters on installing and configuring the individual data services.

  4. Verify that the resource property has been changed.


    # scrgadm pvv -j resource-name
    

Example-Changing a Standard Resource Property

This example shows how to change the system-defined Start_timeout property for the resource (r-1).


# scrgadm -c -j r-1 -y start_timeout=30
# scrgadm -pvv -j r-1

Example-Changing an Extension Resource Property

This example shows how to change an extension property (Log_level) for the resource (r-1).


# scrgadm -c -j r-1 -x Log_level=3
# scrgadm -pvv -j r-1

Clearing the STOP_FAILED Error Flag on Resources

When the Failover_mode resource property is NONE or SOFT and the STOP of a resource fails, the individual resource goes into the STOP_FAILED state and the resource group into the ERROR_STOP_FAILED state. You cannot bring a resource group in this state on any node online, nor can you edit it (create or delete resources, or change resource group or resource properties).

How to Clear the STOP_FAILED Error Flag on Resources

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

For additional information, see scswitch(1M).

Perform this procedure from any cluster node.

  1. Become superuser on a node in the cluster.

  2. Identify which resources have gone into the STOP_FAILED state and on which nodes.


    # scstat -g
    
  3. Manually stop the resources and their monitors on the nodes on which they are in STOP_FAILED state.

    This step might require killing processes or running resource type-specific commands or other commands.

  4. Manually set the state of these resources to OFFLINE on all the nodes on which they were manually stopped.


    # scswitch -c -h nodelist -j resource-name -f STOP_FAILED
    
    -c

    Clears the flag.

    -h nodelist

    Specifies the node names on which the resource was running.

    -j resource-name

    Specifies the name of the resource to take offline.

    -f STOP_FAILED

    Specifies the flag name.

  5. Check the resource group state on the nodes where the STOP_FAILED flag was cleared in Step 4. It should now be OFFLINE or ONLINE.


    # scstat -g
    

    If the resource group remains in the ERROR_STOP_FAILED state, as shown by scstat -g, take the resource group offline on those nodes where it is still in the ERROR_STOP_FAILED state by using the following scswitch command.


    # scswitch -F -g resource-group-name
    

    -F

    Takes the resource group offline on all nodes that can master the group.

    -g resource-group-name

    Specifies the name of the resource group to take offline.

    This situation can occur if the resource group was being switched offline when the STOP method failure occurred and the resource that failed to stop had a dependency on other resources in the resource group. Otherwise, the resource group reverts to the ONLINE or OFFLINE state automatically after you have run the command in Step 4 on all STOP_FAILED resources.

    Now you can switch the resource group to the ONLINE state.

Re-registering Preregistered Resource Types

Two preregistered resource types are: SUNW.LogicalHostname and SUNW.SharedAddress. All logical host name and shared address resources use these resource types. You never need to register these two resource types, but it is possible to accidentally delete them. If you have deleted resource types inadvertently, use the following procedure to re-register them.

For additional information, see scrgadm(1M).

Perform this procedure from any cluster node.

How to Re-register Preregistered Resource Types

    Re-register the resource type.


    # scrgadm -a -t SUNW.resource-type
    
    -a

    Adds a resource type.

    -t SUNW.resource-type

    Specifies the resource type to add (re-register). The resource type can be either SUNW.LogicalHostname or SUNW.SharedAddress.

Example-Re-registering a Preregistered Resource Type

This example shows how to re-register the SUNW.LogicalHostname resource type.


# scrgadm -a -t SUNW.LogicalHostname

Adding or Removing a Node to Or from a Resource Group

This section contains two procedures:

The procedures are slightly different, depending on whether you are adding or removing the node to or from a failover or scalable resource group.

Failover resource groups contain network resources that are used by both failover and scalable services. Each IP subnetwork connected to the cluster has its own network resource specified and included in a failover resource group. This is either a logical host name or a shared address resource. Each network resource includes a list of NAFO groups that it uses. For failover resource groups, you must update the complete list of NAFO groups for each network resource included in the resource group (the netiflist resource property).

For scalable resource groups, in addition to changing the scalable group to be mastered on the new set of hosts, you must repeat the procedure for failover groups that contain the network resources used by the scalable resource.

For additional information, see scrgadm(1M).

Run either of these procedures from any cluster node.

How to Add a Node to a Resource Group

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

Also note the following:

  1. Display the current node list and the current list of NAFO groups configured for each resource in the resource group.


    # scrgadm -pvv -g resource-group | grep -i nodelist
    # scrgadm -pvv -g resource-group | grep -i netiflist
    

    Note -

    The output of the command line for nodelist identifies the nodes by node name; the one for netiflist identifies them by node ID.


  2. Update netiflist for the network resources affected by the node addition.

    This step overwrites the previous value of netiflist, so you must include all NAFO groups here. Also, you must input nodes to netiflist by node ID. To find the node ID, use scconf -p.


    # scrgadm -c -j network-resource -x netiflist=netiflist
    
    -c

    Changes a network resource.

    -j network-resource

    Specifies the name of the network resource (logical host name or shared address) being hosted on the netiflist entries.

    -x netiflist=netiflist

    Specifies a comma-separated list that identifies the NAFO groups on each node. Each element in netiflist must be in the form of NAFO-group-name@nodeid.

  3. Update the node list to include all the nodes that can now master this resource group.

    This step overwrites the previous value of nodelist so you must include all the nodes that can master the resource group here.


    # scrgadm -c -g resource-group -h nodelist
    
    -c

    Changes a resource group.

    -g resource-group

    Specifies the name of the resource group to which the node is being added.

    -h nodelist

    Specifies a comma-separated list of nodes that can master the resource group.

  4. Verify the updated information.


    # scrgadm -pvv -g resource-group | grep -i nodelist
    # scrgadm -pvv -g resource-group | grep -i netiflist
    

Example-Adding a Node to a Resource Group

This example shows how to add a node (phys-schost-2) to a resource group (rg-1), which contains a logical host name resource (schost-2).


# scrgadm -pvv -g rg-1 | grep -i nodelist
(rg-1) Res Group Nodelist:    phys-schost-1 phys-schost-3
# scrgadm -pvv -g rg-1 | grep -i netiflist
(rg-1:schost-2) Res property name: NetIfList
(rg-1:schost-2:NetIfList) Res property class: extension(rg-1:schost-2:NetIfList) List of NAFO interfaces on each node(rg-1:schost-2:NetIfList) Res property type: stringarray(rg-1:schost-2:NetIfList) Res property value: nafo0@1 nafo0@3
 
(Only nodes 1 and 3 have been assigned NAFO groups. You must add a NAFO group for node 2.)

# scrgadm -c -j schost-2 -x netiflist=nafo0@1,nafo0@2,nafo0@3
# scrgadm -c -g rg-1 -h phys-schost-1,phys-schost-2,phys-schost-3
# scrgadm -pvv -g rg-1 | grep -i nodelist
(rg-1) Res Group Nodelist:     phys-schost-1 phys-schost-2 phys-schost-3
# scrgadm -pvv -g rg-1 | grep -i netiflist
(rg-1:schost-2:NetIfList) Res property value: nafo0@1 nafo0@2 nafo0@3

How to Remove a Node from a Resource Group

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

Also note the following:

  1. Update the node list to include all the nodes that can now master this resource group.

    This step removes the node and overwrites the previous value of nodelist; be sure to include all the nodes that can master the resource group here.


    # scrgadm -c -g resource-group -h nodelist
    

    -c

    Changes a resource group.

    -g resource-group

    Specifies the name of the resource group from which the node is being removed.

    -h nodelist

    Specifies a comma-separated list of nodes that can master this resource group.

  2. Display the current list of NAFO groups configured for each resource in the resource group.


    # scrgadm -pvv -g resource-group | grep -i netiflist
    


    Note -

    The output of the above command lines identifies the nodes by node ID.


  3. Update netiflist for network resources affected by the removal of the node.

    This step overwrites the previous value of netiflist; be sure to include all NAFO groups here. Also, you must input nodes to netiflist by node ID. To find the node ID, use scconf -p.


    # scrgadm -c -j network-resource -x netiflist=netiflist
    

    -c

    Changes a network resource.

    -j resource-group

    Specifies the name of the network resource (logical host name or shared address) being hosted on the netiflist entries.

    -x netiflist=netiflist

    Specifies a comma-separated list that identifies the NAFO groups on each node. Each element in netiflist must be in the form of NAFO-group-name@nodeid.

  4. Verify the updated information.


    # scrgadm -pvv -g resource-group | grep -i nodelist
    # scrgadm -pvv -g resource-group | grep -i netiflist
    

Example-Removing a Node from a Resource Group

This example shows how to remove a node (phys-schost-3) from a resource group (rg-1), which contains a logical host name resource (schost-1).


# scrgadm -pvv -g rg-1 | grep -i nodelist
(rg-1) Res Group Nodelist:       phys-schost-1 phys-schost-2 phys-schost-3
# scrgadm -c -g rg-1 -h phys-schost-1,phys-schost-2
# scrgadm -pvv -g rg-1 | grep -i netiflist
(rg-1:schost-1) Res property name: NetIfList(rg-1:schost-1:NetIfList) Res property class: extension(rg-1:schost-1:NetIfList) List of NAFO interfaces on each node(rg-1:schost-1:NetIfList) Res property type: stringarray(rg-1:schost-1:NetIfList) Res property value: nafo0@1 nafo0@2 nafo0@3

(nafo0@3 is the NAFO group to be removed.)

# scrgadm -c -j schost-1 -x netiflist=nafo0@1,nafo0@2
# scrgadm -pvv -g rg-1 | grep -i nodelist
(rg-1) Res Group Nodelist:       phys-schost-1 phys-schost-2
# scrgadm -pvv -g rg-1 | grep -i netiflist
(rg-1:schost-1:NetIfList) Res property value: nafo0@1 nafo0@2

Synchronizing the Startups Between Resource Groups and Disk Device Groups

After a cluster boots up or services fail over to another node, global devices and cluster file systems may take a while before they become available. However, a data service can run its START method before global devices and cluster file systems-on which the data service depends-come online. In this case, the START method times out and you must reset the state of the resource groups used by the data service and restart the data service manually.The resource type SUNW.HAStorage monitors the global devices and cluster file systems and causes the START method of the other resources in the same resource group to wait until they become available. To avoid additional administrative tasks, you should set up SUNW.HAStorage for all the resource groups whose data service resources depend on global devices or cluster file systems.

How to Set Up SUNW.HAStorage Resource Type for New Resources

In the following example, the resource group rg-1 contains three data services:

To create a SUNW.HAStorage resource hastorage-1 for new resources in rg-1, do the following:

  1. Become superuser on a node in the cluster.

  2. Create the resource group rg-1.


    # scrgadm -a -g rg-1
    

  3. Register the resource type.


    # scrgadm -a -t SUNW.HAStorage
    

  4. Create the SUNW.HAStorage resource hastorage-1 and define the service paths.


    # scrgadm -a -j hastorage-1 -g rg-1 -t SUNW.HAStorage \
    
    -x ServicePaths=/global/rg-1,/dev/global/dsk/d5s2,dsk/d6
    

    ServicePaths can contain the following values:

    • Global device group names, such as nfs-dg

    • Paths to global devices, such as /dev/global/dsk/d5s2 or dsk/d6

    • Cluster file system mount points, such as /global/nfs

  5. Enable the hastorage-1 resource.


    # scswitch -e -j hastorage-1
    

  6. Add the resources, iWS, Oracle, and NFS, to rg-1 and set their dependency to hastorage-1. For example, for iWS, type:


    # scrgadm -a -j resource-name -g rg-1 -t SUNW.iws \
    
    -x Confdir_list=/global/iws/schost-1 \
    
    -y Scalable=False -y Network_resources_used=schost-1 \
    
    -y Port_list=80/tcp -y Resource_dependencies=hastorage-1
    

  7. Set rg-1 to the managed state and bring it online.


    # scswitch -Z -g rg-1
    

SUNW.HAStorage contains another extension property, AffinityOn, which is a Boolean that specifies whether SUNW.HAStorage must perform an affinity switchover for the global devices and cluster file systems defined in ServicePaths. For details, see the SUNW.HAStorage(5) man page.

How to Set Up SUNW.HAStorage Resource Type for Existing Resources

To create a SUNW.HAStorage resource for existing resources, do the following:

  1. Register the resource type.


    # scrgadm -a -t SUNW.HAStorage
    

  2. Create the SUNW.HAStorage resource hastorage-1, for example:


    # scrgadm -a -g resource-group-name -j hastorage-1 -t SUNW.HAStorage \
    -x ServicePaths= ... -x AffinityOn=True
    

  3. Enable the hastorage-1 resource.


    # scswitch -e -j hastorage-1
    

  4. Set up the dependency for each of the existing resources, as required.


    # scrgadm -c -j resource-name -y Resource_Dependencies=hastorage-1