Home > Veritas Cluster Server Manual Pages
HARES (1M) |
|
Maintenance Commands |
Table of contents
hares - manage individual resources that make up service groups in a cluster
hares -add res type group
hares -delete [-force] res
hares -local res attr
hares -global res attr value | key | { key value }
hares -action res action_token [-actionargs arg1 arg2 ] -sys system [-clus cluster | -localclus]
hares -link parent_res child_res
hares -unlink parent_res child_res
hares -clear res [-sys system]
hares -online [-force] res -sys system
hares -offline [-ignoreparent] res -sys system
hares -refreshinfo res [-sys system] -clus cluster | -localclus
hares -flushinfo res [-sys system] -clus cluster | -localclus
hares -offprop [-ignoreparent] res -sys system
hares -override res static_attribute
hares -undo_override res static_attribute
hares -probe res -sys system
hares -dep [resource(s)]
hares -display [resource(s)] [-attribute attribute(s)] [-group group(s)] [-type type(s)] [-sys systems] [-clus | -localclus]
hares -display -ovalues [resource(s)] [-group group(s)] [-type type(s)]
hares -state [res -sys system] [-clus cluster | -localclus]
hares -list [conditional(s)] [-clus cluster | -localclus]
hares -value res attr [system] [-clus cluster | -localclus]
hares -wait resource attribute value [-clus cluster] [-sys system] [-time timeout]
hares -help [ -modify | -list]
VRTSvcs
The
hares
command administers resources in the cluster. Resources are individual representations of the elements required for a service group to be available, such as a volume, a database, or an IP address. See NOTES for how to specify "-" and "%" characters in command line.
-
-add res type group
-
Add a resource
res
of
type, which is a member of
group.
-
-delete res
-
Delete a resource from the configuration. If the value of the Cluster attribute DeleteOnlineResource is 1 which is the default, then the
-delete
option deletes the resource even if the resource is online. If the value of the DeleteOnlineResource is set to 0, then the resource must be offline for the
hares -delete
command to succeed.
You can use the -force option to delete a resource that is online. The -force option disregards the value of the Cluster attribute DeleteOnlineResource. Even if the value is set to 0 and the resource is online, the -force option deletes the resource.
-
-local res attr
-
Localize an attribute. That is, the current value is converted to an association in which the keys are the systems of the resource group's
SystemList
attribute. Localized attributes may have a different value for each system in the
SystemList.
-
-global res attr value ... | key ... | { key value }
-
Change the scope of a local attribute (one that has a value or set of values for every system on which a resource's group is configured to run) to the scope of a global attribute (a single value or a set of values for all systems). This value is the one specified.
-
-action res action_token [-actionargs arg1 arg2 ...] -sys system [-clus cluster | -localclus]
-
Specifies that an action corresponding to the
action_token
be taken by the agent for the specified resource. A system is required. A cluster may be specified as applicable.
action_token
is one of a set of customized actions indicated in the resource type definition. Agent developers are responsible for defining the actions and initializing the static attribute SupportedActions in the resource type definition. If arguments are required for the indicated action, they may be specified using the optional
-actionargs
flag. See the documentation provided with the agent for information about arguments for specific actions. Use the
-clus
or
-localclus
option to indicate a specific cluster. For a system whose name is not unique among clusters, specify the name of its cluster.
-
-link parent_res child_res
-
Specify a dependency between two resources. The parent resource depends on the child; that is, the child is brought online before the parent resource, but the parent resource is taken offline before the child.
-
-unlink parent_res child_res
-
Remove the dependency between two resources.
-
-clear res [-sys system]
-
Clear a faulted resource by changing the state from
faulted
to
offline. If no system is specified, the resource is cleared on all systems on which it is faulted. This command automatically clears all faulted resources that depend directly or indirectly (that is, resources that have parents in the dependency tree) on the specified resource.
-
-online [-force] res -sys system
-
Bring the resource online on the specified system. All child resources are first brought online, if they are not already online.
-
-offline [-ignoreparent] res -sys system
-
Take the resource offline on the specified system. The
-ignoreparent
option allows children to be taken offline even if parent resource is online.
-
-refreshinfo res [-sys system] -clus cluster | -localclus
-
The refreshinfo
option causes the Info entrypoint to update the value of the ResourceInfo resource level attribute for the specified resource if the resource is online. If the Info entrypoint is successful, no output is displayed. If the Info entrypoint fails, the output of
-refreshinfo
contains the text of the returned error. If no system or remote cluster is specified, the Info entrypoint runs on system(s) in the local cluster where the resource is online. If a system is specified, in either the local cluster or a remote cluster, the Info entrypoint is run only if the resource is online on the system; if the resource is not online on that specified system, the refreshinfo command fails. If a remote cluster is specified without the system name, the Info entrypoint runs on those systems in the remote cluster where the resource is online.
Use the
-clus
or
-localclus
option to indicate a specific cluster. For a system whose name is not unique among clusters, specify the name of its cluster.
-
-flushinfo res [-sys system] -rclus remote_cluster][-clus cluster | -localclus
-
Causes the clearing of current values of the ResourceInfo resource level attribute for the specified resource. The resource need not be online to run this command. The default value for the ResourceInfo attribute, which is restored as a result of running this command, is represented by three string-association keys: State=valid, Msg="", TS="current_date_and_time". If the ResourceInfo attribute is global, a system need not be specified; the attribute is reset for the resource on all systems in the local cluster, or, if a remote cluster is specified, on all systems in the remote cluster. If the ResourceInfo attribute is local, the system for which the ResourceInfo attribute should be flushed must be specified, and its value is reset only for the specified system. Use the
-clus
or
-localclus
option to indicate a specific cluster. For a system whose name is not unique among clusters, specify the name of its cluster.
-
-offprop [-ignoreparent] res -sys system
-
Offline the resource on the specified system, and signal that its children should be taken offline. The [-ignoreparent] option allows child resource to be taken offline and the message propagated to its children even if the parent resource of the child resource is online. This action continues to the leaves of the resource's subtree.
-
-override res static_attribute
-
For a given resource, permit a static resource type attribute to be overridden. After using this command, use the
modify
option to modify the value. You can use the
display
option to see values of overridden attributes. The override attribute can be removed using the
-undo_override
option.
-
-undo_override res static_attribute
-
Remove the overridden static attribute from the resource's list of attributes.
-
-probe res -sys system
-
Monitor the resource on the specified system. Resource sends current state to VCS engine, which will take appropriate action.
-
-dep [resource(s)]
-
Displays dependency information about the specified
resource(s). If
resource(s)
is omitted, dependency information for all resources is displayed.
-
-display [resource(s)] [-attribute attribute(s)] [-group group(s)] [-type type(s)] [-sys systems] [-clus|-localclus]
-
-
-display -ovalues [resource(s)] [-group group(s)] [-type type(s)]
-
Display resource attribute values for the specified
resource(s),
group(s),
type(s),
system(s), or
attribute(s). Overridden values for attributes are displayed by using the
-ovalues
option. Multiple options may be used. If no option is specified, attribute values for all resources are displayed, including overridden values. The display of the ResourceInfo attribute value shows only 20 characters. Use the
-value
option to display the full text of a larger value.
-
-state [res -sys system] [-clus cluster | -localclus]
-
Return the current state of the resource on the specified system. If the Global Cluster option is in use, the command returns the state of the resource on all clusters. Use the
-clus
or
-localclus
option to indicate a specific cluster. For a system whose name is not unique among clusters, specify the name of its cluster.
-
-list [conditional(s)] [-clus cluster | -localclus]
-
Displays a list of resources whose values match given conditional statement(s). Conditional statements can take three forms: Attribute=Value, Attribute!=Value, Attribute=~Value. Multiple conditional statements imply AND logic. If no conditional statement is specified, all resources in the cluster are listed. If the Global Cluster option is in use, the command lists the resources on all clusters. Use the
-clus
or
-localclus
option to indicate a specific cluster. For a system whose name is not unique among clusters, specify the name of its cluster.
-
-value res attr [system] [-clus cluster | -localclus]
-
The
-value
option is used instead of the
-display
option when one specific attribute value is needed rather than a table of many attribute values. For example, "hares -value File9 State sysb" displays the value of the State attribute for resource File9 on system sysb. The system name must be specified for local attribute values but not for global attribute values. If the Global Cluster option is in use, the command displays the values for the attribute on all clusters. Use the
-clus
or
-localclus
option to indicate a specific cluster. For a system whose name is not unique among clusters, specify the name of its cluster.
-
-wait resource attribute value [-clus cluster] [-sys system] [-time timeout]
-
The
-wait
option is for use in scripts to direct the
hares
command to block until the value of the attribute is changed as specified, or until the
timeout
expires. If a
timeout
is not specified, the command line interface blocks indefinitely.
timeout
is an integer specifying seconds. The
-wait
option can be used only with changes to scalar attributes. The
-sys
option can be applied only when the scope of the attribute is local. The
-clus
option applies only when applying the
-wait
option in a Global Cluster environment. The scalar resource level attributes on the remote cluster are limited to those capable of being displayed using the
hares -displayresource-clusremote_cluster
command. See EXAMPLES.
-
-help [-modify |-list]
-
Display information about using
hares. The
-modify
option provides
-modify
specific help. The
-list
option provides
-list
specific help.
-
-modify [ modify_options ]
-
The
-modify
option lets you modify a resource's attributes.
You may modify a scalar attribute's existing value. You may not use
-modify
to change values already defined for a vector, a keylist, or an association attribute. For vector, keylist, and association attributes, use the
modify_options, which include
-add,
-delete,
-update, or
-delete -keys. Refer to the following list of permissible
-modify
commands. You may display the commands by using
-hares -help -modify.
-
SCALAR
-
hares -modify res attr value [-sys system]
-
VECTOR
-
Use the following command only when the vector attribute has no value:
hares -modify res attr value [-sys system]
For vector attributes that have values defined, use only the following allowed operations.
hares -modify res attr -add value [-sys system]
hares -modify res attr -delete -keys [-sys system]
Note:
You cannot delete an individual element of a VECTOR.
-
KEYLIST
-
Use the following command only when the keylist attribute has no value:
hares -modify res attr key [-sys system]
For keylist attributes that have values defined, use only the following allowed operations.
hares -modify res attr -add key [-sys system]
hares -modify res attr -delete key [-sys system]
hares -modify res attr -delete -keys [-sys system]
-
ASSOCIATION
-
Use the following command only when the keylist attribute has no value:
hares -modify res attr {key value} [-sys system]
For association attributes that have values defined, use only the following allowed operations.
hares -modify res attr -add {key value} [-sys system]
hares -modify res attr -update {key value} [-sys system]
hares -modify res attr -delete key [-sys system]
hares -modify res attr -delete -keys [-sys system]
To online resource
db_volume
on system
mars01, enter:
# hares -online db_volume -sys mars01
From a script, to use the
-wait
option to direct the
hares
command to block until the resource
db_volume
is
ONLINE
on system
mars01, enter:
# hares -wait db_volume State ONLINE -sys mars01
In some instances, the VCS server may ignore the
hares
commands. For example, VCS will not allow you to bring a resource online that is part of a failover service group on a system if the group is active (at least one resource is online, or waiting to go online) elsewhere in the cluster.
A resource may be a member of only one group.
Resource names must be unique throughout the cluster.
When using the command to specify or modify an attribute's value that begins with a dash ("-"), precede the value with a percent sign ("%"). For example, specify -y as %-y. Likewise, precede a value that starts with a percent sign with another percent sign.
hagrp(1M)
Copyright (c) 2008 Symantec.
All rights reserved.
Last updated: 07/03/2008
Copyright ©2009 Symantec Corporation
All rights reserved.