View Source

h1. Sun Cluster 3.1 Command Line Cheat Sheet

This page describes basic Sun Cluster 3.1 administration commands, including the following command line interface commands: {{scrgadm}}, {{scswitch}}, {{scconf}}, {{scstat}}, and {{scdpm}}.

h2. {{scrgadm}}

*\-\-\-\-\- Manage registration and unregistration of resource types, resource groups, and resources \-\-\-\-\-*

||*Action*||*Object*||*Who*||*What*||*Hosts*
|{{-a}} (add)|{{-g}} (group)|{{-h}} (physical host)|{{-x}} (extensionparam=value)|{{-l}} (logical host)|
|{{-c}} (change)|{{-j}} (resource)|{{-f _registration-file_ _path_}}|{{-y}} (param=value)| |
|{{-r}} (remove)|{{-t}} (resource type)| | | |
|{{-p\[vv\]}} (print)\\ {{v}} = state of resources\\ {{vv}} = parameter values|{{-L}} (for Logicalhostnames) {{-n _netiflist_}}| | | |
| |{{-S}} (for Shared Addresses) {{-n _netiflist_ -X _auxnodelist_}}| | | |

h2. Examples

Register a resource type named {{MyDatabase}}:

{panel:borderStyle=solid}
\# scrgadm -a -t MyDatabase
{panel}

Create a failover resource group named {{MyDatabaseRG}}:

{panel:borderStyle=solid}
\# scrgadm -a -g MyDatabaseRG
{panel}

Create a scalable resource group named {{MyWebServerRG}}:

{panel:borderStyle=solid}
\# scrgadm -a -g MyWebServerRG \
-y Maximum_primaries=_integer_ \
-y Desired_primaries=_integer_
{panel}

Create a resource of a given type in a resource group:

{panel:borderStyle=solid}
\# scrgadm -a -j _resource-name_ -t _resource-type-name_ -g _RG-name_
{panel}

See the [rg_properties(5)|http://docs.sun.com/app/docs/doc/819-0582/6n30g7iku?l=en&a=view&q=rg_properties] man page for a description of the resource group properties. See the [r_properties(5)|http://docs.sun.com/app/docs/doc/819-0582/6n30g7ikv?l=en&a=view&q=r_properties] man page for a description of the resource properties.

h2. {{scconf}}

*\-\-\-\-\- Update the Sun Cluster software configuration \-\-\-\-\-*

||*Action*||*Object*||*What*||
|{{-a}} (add)|{{-C}} (cluster option)|{{cluster=_clustername_}}|
|{{-c}} (change)|{{-A}} (adapter)|{{add: trtype=_type_,name=_name_,node=_node_\[,_other-options_\] change name=_name_,node=_node_\[,state=_state_\]\[,_other-options_remove name=_name_,node=_node_}}|
|{{-r}} (remove)|{{-B}} (transport junction)|{{add: type=_type_,name=_name_\[,_other-options_\] change name=_name_\[,state=_state_\]\[,_other-options_\] remove name=_name_}}|
|{{-p\[vv\]}} (print)|{{-m}} (cable endpoint)|{{add: endpoint=\[_node_:\]_name_\[@_port_\],endpoint=\[_node_:\]_name_\[@_port_\]\[,noenable\] change: endpoint=\[_node_:\]_name_\[@_port_\],state=_state_ remove: endpoint=\[_node_:\] _name_\[@_port_\]}}|
| |{{-P}} (private net name)|{{add: node=_node_\[,privatehostname=_node_\[,privatehostname=_hostalias_\]}}|
| |{{-q (quorum)}}|{{add: globaldev=_devicename_\[,node=_node_,node=_node_\[,...\]\] change: node=_node_,\{maintstate \| reset]} change globaldev= _devicename_,\{maintstate \| reset\} change:resetchange: installmoderemove: globaldev=_devicename_}}|
| |{{-D}} (devicegroup)|{{add: type=_type_,name=_name_\[,nodelist=_node_ \[: _node_\]...\]\[,preferenced=\{true \| false\}\]\[,failback=\{enabled \| disabled\}\]\[,_otheroptions_ \] change name=_name_ \[,nodelist=_node_\[:_node_\]...\]\[,preferenced=\{true \| false\}\]\[,failback=\{enabled \| disabled\}\]\[,_other-options_ \] removename=_name_ \[,nodelist=_node_\[:_node_\]...\]}}|
| |{{-T}} (authentication)|{{add: node=_nodename_\[,...\]\[,authtype=_authtype_\] change authtype=_authtype_ remove \{node=_nodename_ \[,...\] \| all\} }}|
| |{{-h (nodes)}}|{{add: node=_nodename_ remove node=_nodename or nodeID_}}|

h2. Examples

Register a new disk group:

{panel:borderStyle=solid}
\# scconf -a -D type=vxvm,name=new-disk-group,nodelist=nodex:nodex
{panel}

Synchronize device group information after adding a volume:

{panel:borderStyle=solid}
\# scconf -c -D name=diskgroup,sync
{panel}

Add a shared quorum device to the cluster:

{panel:borderStyle=solid}
\# scconf -a -q globaldev=nodename
{panel}

Clear "installmode":

{panel:borderStyle=solid}
\# scconf -c -q reset
{panel}

Configure a second set of cluster transport connections:

{panel:borderStyle=solid}
\# scconf -a \
-A trtype=transport,name=ifname1,node=nodename1 \
-A trtype=transport,name=ifname2,node=nodename2 \
-m endpoint=nodename1:ifname1,endpoint=nodename2:ifname2
{panel}

Secure the cluster against other machines that might attempt to add themselves to the cluster:

{panel:borderStyle=solid}
\# scconf -a -T node=.
{panel}

h2. {{scswitch}}

*\-\-\-\-\- Perform ownership/state change of resource groups and disk device groups in Sun Cluster configurations \-\-\-\-\-*

||*Action*||*Object*||*Who*||*Special*||
|{{-z}} (bring online)|{{-g}} (resource group) {{-D}} (device group)|{{-h}} (target host)|{{-h ""}} (no receiver) takes resource group offline|
|{{-Z}} (bring everything online)|{{-g}} (resource group)| |no {{-g}} brings all resource groups online|
|{{-F}} (take offline for all nodes)|{{-g}} (resource group){{-D}} (device group)| | |
|{{-S}} (switch all DG and RG)| |{{-h}} (losing host)|{{-K _#_}} specifies the number of seconds to keep resource groups from switching back onto a node after that node has been successfully evacuated. Default is 60 seconds, and can be set up to 65535 seconds. Starting with Sun Cluster 3.1 Update 3.|
|{{-R}} (restart all RG)| |{{-h}} (target host)| |
|{{-m}} (set maintenance mode)|{{-D}} (device group)| | |
|{{-u}} (unmanage RG)|{{-g}} (resource group)| |{{-M}} disables monitoring only|
|{{-o}} (online RG)|{{-g}} (resource group)| |{{-M}} disables monitoring only|
|{{-e}} (enable resource)|{{-j}} (resource)| | |
|{{-n}} (disable resource)|{{-j}} (resource)| | |
|{{-c}} (clear flag {{STOP_FAILED}})|{{-j}} (resource) {{-f}} (flag name)|{{-h}} (target host)| |
|{{-Q}} (quiesce resource group (starting in Sun Cluster 3.1 update 3))|{{-g}} (resource group)| | |

h2. Examples

Switch over _resource-grp-2_ to be mastered by _node1:_

{panel:borderStyle=solid}
\# scswitch -z -h node1 -g resource-grp-2
{panel}

Switch over _resource-grp-3_, a resource group configured to have multiple primaries, to be mastered by _node1_, _node2_, _node3_:

{panel:borderStyle=solid}
\# scswitch -z -h node1,node2,node3 -g resource-grp-3
{panel}

Switch all managed resource groups online on their most _preferred_ node or nodes:

{panel:borderStyle=solid}
\# scswitch -z
{panel}

Quiesce _resource-grp-2_. Stops RG from _continuously_ bouncing around from one node to another in the event of the failure of a {{START}} or {{STOP}} method:

{panel:borderStyle=solid}
\# scswitch -Q -g resource-group-2
{panel}

Switch over all resource groups and disk device groups from _node1_ to a new set of primaries:

{panel:borderStyle=solid}
\# scswitch -S -h node1
{panel}

Restart some resource groups on specified nodes:

{panel:borderStyle=solid}
node1\# scswitch -R -h node1,node2 -g resource-grp-1,resource-grp-2
{panel}

Disable some resources:

{panel:borderStyle=solid}
\# scswitch -n -j resource-1,resource-2
{panel}

Enable a resource:

{panel:borderStyle=solid}
\# scswitch -e -j resource-1
{panel}

Take resource groups to the unmanaged state:

{panel:borderStyle=solid}
\# scswitch -u -g resource-grp-1,resource-grp-2
{panel}

Take resource groups to the online state:

{panel:borderStyle=solid}
\# scswitch -o -g resource-grp-1,resource-grp-2
{panel}

Switch over _device-group-1_ to be mastered by _node2:_

{panel:borderStyle=solid}
\# scswitch -z -h node2 -D device-group-1
{panel}

Put _device-group-1_ into maintenance mode:

{panel:borderStyle=solid}
\# scswitch -m -D device-group-1
{panel}

Move all resource groups and disk device groups persistently off of a node:

{panel:borderStyle=solid}
\# scswitch -S -h iloveuamaya -K 120
{panel}

This situation arises when resource groups attempt to switch back automatically when strong negative affinities have been configured (with {{RG_affinities}}).

h2. {{scstat}}

*\-\-\-\-\- Monitor the status of Sun Cluster \-\-\-\-\-*

||*Action*||*Options*||
|{{-D}} (shows status for all disk groups)| |
|{{-g}} (shows status for all resource groups)|{{-h host}} (show status of all components related to specified host)|
|{{-i}} (shows status for all IPMP groups and public network adapters)| |
|{{-n}} (shows status for all nodes)| |
|{{-h host}} (shows status for the specified node)| |
|{{-p}} (shows status for all components in the cluster)|{{-v\[v\]}} verbose output|
|{{-q}} (shows status for all device quorums and node quorums)| |
|{{-W}} (shows status for cluster transport path)| |

h2. Examples

Show status of all resource groups followed by the status of all components related to node1:

{panel:borderStyle=solid}
\# scstat -g -h node1
{panel}

or:

{panel:borderStyle=solid}
\# scstat -g
{panel}

and

{panel:borderStyle=solid}
\# scstat -h node1
{panel}

h2. {{scdpm}}

Available starting in Sun Cluster 3.1 update 3.

*\-\-\-\-\- Disk-path monitoring administration command \-\-\-\-\-*

||*Action*||*What*||
|{{-m}} (monitor the new disk path that is specified by node:disk path. All is default option)|{{\[node\]}} \\ \[node:all\] \\ \[node:/dev/dis/rdsk/d-\]|
|{{-u}} (unmonitor a disk path. The daemon on each node stops monitoring the specified path. All is default option)|{{\[node\]}} \\ \[node:all\] \\ \[node:/dev/dis/rdsk/d-\]|
|{{-p \[-F\]}} (print current status of a specified disk path from all the nodes that are attached to the storage. All is default option. The {{-F}} option prints only faulty disk paths)|{{\[node\]}} \\ \[node:all\] \\ \[node:/dev/dis/rdsk/d-\]|
|{{-f filename}} (read the list of disk paths to monitor or unmonitor for a specified file name.)| |

h2. Examples

Force daemon to monitor all disk paths in the cluster infrastructure:

{panel:borderStyle=solid}
\# scdpm -m all
{panel}

Monitor a new path on all nodes where path is valid:

{panel:borderStyle=solid}
\# scdpm -m /dev/did/dsk/d3
{panel}

Monitor new paths on just {{node1}}:

{panel:borderStyle=solid}
\# scdpm -m node1:d4 -m node1:d5
{panel}

Print all disk paths in the cluster and their status:

{panel:borderStyle=solid}
\# scdpm -p all:all
{panel}

Print all failed disk paths:

{panel:borderStyle=solid}
\# scdpm -p -F all
{panel}

Print the status of all disk paths from {{node1}}:

{panel:borderStyle=solid}
\# scdpm -p node1:all
{panel}

h2. Covered Products

Sun Cluster 3.1 8/05\\ Sun Cluster 3.1 7/05\\ Sun Cluster 3.1 4/04\\ Sun Cluster 3.1 10/03 for SunPlex Systems\\ Sun Cluster 3.1\\ Sun Cluster 3.0 5/02\\ Sun Cluster 3.0 12/01\\ Sun Cluster 3.0 7/01\\ Sun Cluster 3.0\\

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact