Sun Cluster Common Tasks

This sheet contains common tasks for both Sun Cluster 3.1 and 3.2, I will try not to dupilcate the same stuff I have in the Sun Cluster cheatsheet.

Cluster Tasks

 
3.1
3.2
shutdown entire cluster

##other nodes in cluster
scswitch -S -h <host>
shutdown -i5 -g0 -y

## Last remaining node
scshutdown -g0 -y

cluster shutdown -g0 -y
shutdown single node
scswitch -S -h <host>

## login to the node that you wish to shutdown
shutdown -i5 -g0 -y
## login to the node that you wish to shutdown
clnode evacuate <node>
shutdown -i5 -g0 -y
reboot a node into non-cluster mode
ok> boot -x
ok> boot -x
Backup the cluster  

/usr/cluster/bin/cluster export -o <configfile>

Note: the export command will create a XML file of the configuration of the cluster, this file can then be imported

Node Tasks

 
3.1
3.2
Put a node into maintenance state

scconf -c -q node=<node>,maintstate

Note: use the scstat -q command to verify that the node is in maintenance mode, the vote count should be zero for that node.

## On the node to be disabled
clnode evacuate <node>
shutdown -i0 -g0 -y

## On another node within the cluster
clquorum disable -t node <node>
clquorum status -t node
Get a node out of maintenance state

scconf -c -q node=<node>,reset

Note: use the scstat -q command to verify that the node is in maintenance mode, the vote count should be one for that node.

## On the node to be disabled
clnode evacuate <node>
shutdown -i0 -g0 -y

## On another node within the cluster
clquorum enable -t node <node>
clquorum status -t node
Adding a node to the cluster  

## Make sure that all the cluster software has been installed see installation

## using the clsetup text GUI
clsetup

## Commandline
clnode add [-c <cluster>] [-n <sponsornode>] \
-e <endpoint> \
-e <endpoint>
<node>

Removing a node from the cluster  

## Make sure that all the cluster software has been
## installed see installation

## using the clsetup text GUI
clsetup

## Commandline, make sure you are on the node that
## you wish to remove
clnode remove

Evacuate a node from the cluster scswitch -S -h <node> clnode evacuate <node>

Quorum Tasks

 
3.1
3.2
Replacing a faulty quorum device

1. Create new temporary quorum device
2. remove qurom device with faulty disk
3. replace disk
4. Create quorum device with new disk
5. Remove temporary quorum device

Note: commands can be fond in the cheatsheet

1. Create new temporary quorum device
2. remove qurom device with faulty disk
3. replace disk
4. Create quorum device with new disk
5. Remove temporary quorum device

Note: commands can be fond in the cheatsheet

Adding a NetApp NAS quorum device n/a 1. Install the ISCSI license from NetApp
2. configure a ISCSI LUN
3. Configure the NetApp to use NTP
4. configure the cluster to see the ISCSI device
5. configure the cluster to use the ISCSI device

Note: make sure that the NetApp uses the same NTP server as the cluster. Also a cluster can use a NAS device for only a single quorum device

Devices

 
3.1
3.2
Display the global SCSI protocol settings

 

cluster show -t global

Display device settings   cldevice show <device>

Miscellanous

 
3.1
3.2
Adding a new veritas volume

##Create a volume

    vxassist –g nfsdg make vol-01 500m
 
## Resync the cluster with volume manager
    
    scconf –c –D name=<disk group>,sync
 
## Create filesystem on new volume, if you get a error where the
## device cannot be found then the cluster is not synced with
## volume manager use the above command to resync
    
    mkfs –F vxfs –o largefiles   /dev/vx/rdsk/nfsdg/vol-01
 
## Create mount point
    
    mkdir /global/nfs
 
## Create the vfstab entry
    
    /dev/vx/dsk/nfsdg/vol-01 /dev/vx/rdsk/nfsdg/vol-01             /global/nfs vxfs 2 yes global,logging
 
## Mount the filesystem on both nodes
    
    mount /global/nfs
 
## Switch the disk group to another node (remember the group
## only is what switches)
    
    scswitch –z –D nfsdg –h sun2

##Create a volume

    vxassist –g nfsdg make vol-01 500m
 
## Resync the cluster with volume manager
    
    cldevicegroup sync <diskgroup>
 
## Create filesystem on new volume, if you get a error where the
## device cannot be found then the cluster is not synced with
## volume manager use the above command to resync
    
    mkfs –F vxfs –o largefiles   /dev/vx/rdsk/nfsdg/vol-01
 
## Create mount point
    
    mkdir /global/nfs
 
## Create the vfstab entry
    
    /dev/vx/dsk/nfsdg/vol-01 /dev/vx/rdsk/nfsdg/vol-01             /global/nfs vxfs 2 yes global,logging
 
## Mount the filesystem on both nodes
    
    mount /global/nfs
 
## Switch the disk group to another node (remember the group
## only is what switches)
    
   cldevicegroup switch -n <nodename> <devgrp>

Remove and unregister a disk group

## Make use that all resources using the disk group are offline
## and removed

## Take the device group offline
    
    scswitch -F -D appdg
 
## Unregister the disk group
    
    scconf -r -D name=appdg

Note: if you have problems regarding the device being busy use the vxdg -t import command then follow from step 1

## Make use that all resources using the disk group are offline
## and removed

## Take the device group offline
    
    cldevicegroup offline <devgrp>
 
## Remove the disk group
    
    cldevicegroup remove-device -d <device> <devgrp>

Note: if you have problems regarding the device being busy use the vxdg -t import command then follow from step 1

Create a failover resource group with HAstoragePlus and logicalHostname resources ## Register resource types

    scrgadm -a -t SUNW.HAStoragePlus
    scrgadm -a -t SUNW.LogicalHostname

## Create the FAILOVER resource group

    scrgadm -a -g rg_oracle -h sun1,sun2

## Create the LogicalHostname failover resource

    scrgadm -a -L -g rg_oracle -j oraserver -l oraserver -n \    
    ipmp0@sun1,ipmp0@sun2

## Create the HAStoragePlus failover resource

    scrgadm -a -g rg_oracle -j hasp_data01 -t SUNW.HAStoragePlus \
    -x FileSystemMountPoints=/oracle/data01 \
    -x Affinityon=true

## Enable the resources (disabled by default)

    scswitch -e -j oraserver
    scswitch -e -j hasp_data01

## Online the resource group

    scswitch -Z -g rg_oracle

Note: the ipmp network group was created using the above IP Networking group information, also the mountpoint was added to the /etc/vfstab file

## Register resource types

    clresource register SUNW.HAStoragePlus
    clresource register SUNW.LogicalHostname

## Create the FAILOVER resource group

    clresourcegroup create <res_group> -n <node>,<node>

## Create the LogicalHostname failover resource

    clreslogicalhostname create -g <res_group> \
    -h <logical_host> -N ipmp_group@sun1,ipmp_group@sun2
    <reslogicalhostname>

## Create the HAStoragePlus failover resource

    clresource create -g <resource_group> \
    -t SUNW.HAStoragePlus -p FilesystemMountPoints=<mountpoint> \
    -p Affinityon=true \
    <resource_name>

## Enable the resources (disabled by default)

    clresource enable oraserver
    clresource enable hasp_data01

## Online the resource group

    clresourcegroup online rg_oracle

Note: the ipmp network group was created using the above IP Networking group information, also the mountpoint was added to the /etc/vfstab file

Create a scalable resource group with HAstoragePlus and shared address resources

## Register resource types

    scrgadm -a -t SUNW.HAStoragePlus
    scrgadm -a -t SUNW.LogicalHostname

## Create the SCALABLE resource group

    scrgadm -a -g rg_oracle \
    -y maximum_primaries=? \
    -y desired_primaries=? \
    -y RG_dependencies=<depend-resource-group> \
    -h sun1,sun2

## Create the LogicalHostname scalable resource

    scrgadm -a -S -j oraserver -g rg_oracle -l oraserver -n \     ipmp0@sun1,ipmp0@sun2

## Create the HAStoragePlus failover resource

    scrgadm -a -g rg_oracle -j hasp_data01 -t SUNW.HAStoragePlus \
    -x FileSystemMountPoints=/oracle/data01 \
    -x Affinityon=true

# Enable the resources (disabled by default)

   scswitch -e -j oraserver
   scswitch -e -j hasp_data01

## Online the resource group

    scswitch -Z -g rg_oracle

Note: the ipmp network group was created using the above IP Networking group information, also the mountpoint was added to the /etc/vfstab file

## Register resource types

    clresource register SUNW.HAStoragePlus
    clresource register SUNW.LogicalHostname

## Create the SCALABLE resource group

    clresourcegroup create
    -p Maximum_primaries=<m> \
    -p Desired_primaries=<n> \
    -p RG_dependencies=<depend-resource-group> \
    -n <node>,<node>
    <res_group>

## Create the LogicalHostname scalable resource

    clreslogicalhostname create -g <res_group> \
    -h <logical_host> \
    -N ipmp0@sun1,ipmp0@sun2 \
    <reslogicalhostname>

## Create the HAStoragePlus failover resource

    clresource create -g <res_group> \
    -t SUNW.HAStoragePlus \
    -p FilesystemMountPoints=<mountpoint> \
    -p Affinityon=true \
    <res_name>

# Enable the resources (disabled by default)

    clresource enable oraserver
    clresource enable hasp_data01

## Online the resource group

    clresourcegroup online rg_oracle

Note: the ipmp network group was created using the above IP Networking group information, also the mountpoint was added to the /etc/vfstab file

Remove a resource type

## Disable the resource type

    scswitch -n -j <resource>

## Remove each resource of the resource type that you will remove

    scrgadm -r -j <resource>

## Remove the resource type

    scrgadm -r -t <resource>

## Disable the resource type

    clresource disable <resource>

## Remove each resource of the resource type that you will remove

    clresource delete <res_name>

## Remove the resource type

    clresource unregister <res_type>

Installing agents scinstall -ik -s apache -d <path to were the agent is>

Note: you can also use scsetup (option 3)