The following steps show the use of cluster_mgr interactively to define a resource type called newresourcetype. Note that you can have multiple resource types. For example, if you want to have some IP addresses that allow local restart (restart mode = 0) and some that do not (restart mode = 1), you can copy the IP_address type to a new type named IP_address2 and change just that value in the IP_address2.
Note: A resource type name cannot contain a space, an unprintable character, or any of the following characters:
*
?
\
#
Log in as root.
Execute the cluster_mgr command using the -p option to prompt you for information (the command name can be abbreviated to cmgr):
# /usr/lib/failsafe/bin/cluster_mgr -p Welcome to Linux FailSafe Cluster Manager Command-Line Interface cmgr> |
Use the set subcommand to specify the default cluster used for cluster_mgr operations. In this example, we use a cluster named test:
cmgr> set cluster test |
Note: If you prefer, you can specify the cluster name as needed with each subcommand.
Use the define resource_type subcommand. By default, the resource type will apply across the cluster; if you wish to limit the resource type to a specific node, enter the node name when prompted. If you wish to enable restart mode, enter 1 when prompted.
Note: The following example only shows the prompts and answers for two action scripts (start and stop) for a new resource type namednewresourcetype.
cmgr> define resource_type newresourcetype
(Enter "cancel" at any time to abort)
Node[optional]?
Order ? 300
Restart Mode ? (0)
DEFINE RESOURCE TYPE OPTIONS
1) Add Action Script.
2) Remove Action Script.
3) Add Type Specific Attribute.
4) Remove Type Specific Attribute.
5) Add Dependency.
6) Remove Dependency.
7) Show Current Information.
8) Cancel. (Aborts command)
9) Done. (Exits and runs command)
Enter option:1
No current resource type actions
Action name ? start
Executable Time? 40000
Monitoring Interval? 0
Start Monitoring Time? 0
1) Add Action Script.
2) Remove Action Script.
3) Add Type Specific Attribute.
4) Remove Type Specific Attribute.
5) Add Dependency.
6) Remove Dependency.
7) Show Current Information.
8) Cancel. (Aborts command)
9) Done. (Exits and runs command)
Enter option:1
Current resource type actions:
Action - 1: start
Action name stop
Executable Time? 40000
Monitoring Interval? 0
Start Monitoring Time? 0
1) Add Action Script.
2) Remove Action Script.
3) Add Type Specific Attribute.
4) Remove Type Specific Attribute.
5) Add Dependency.
6) Remove Dependency.
7) Show Current Information.
8) Cancel. (Aborts command)
9) Done. (Exits and runs command)
Enter option:3
No current type specific attributes
Type Specific Attribute ? integer-att
Datatype ? integer
Default value[optional] ? 33
1) Add Action Script.
2) Remove Action Script.
3) Add Type Specific Attribute.
4) Remove Type Specific Attribute.
5) Add Dependency.
6) Remove Dependency.
7) Show Current Information.
8) Cancel. (Aborts command)
9) Done. (Exits and runs command)
Enter option:3
Current type specific attributes:
Type Specific Attribute - 1: export-point
Type Specific Attribute ? string-att
Datatype ? string
Default value[optional] ? rw
1) Add Action Script.
2) Remove Action Script.
3) Add Type Specific Attribute.
4) Remove Type Specific Attribute.
5) Add Dependency.
6) Remove Dependency.
7) Show Current Information.
8) Cancel. (Aborts command)
9) Done. (Exits and runs command)
Enter option:5
No current resource type dependencies
Dependency name ? filesystem
1) Add Action Script.
2) Remove Action Script.
3) Add Type Specific Attribute.
4) Remove Type Specific Attribute.
5) Add Dependency.
6) Remove Dependency.
7) Show Current Information.
8) Cancel. (Aborts command)
9) Done. (Exits and runs command)
Enter option:7
Current resource type actions:
Action - 1: start
Action - 2: stop
Current type specific attributes:
Type Specific Attribute - 1: integer-att
Type Specific Attribute - 2: string-att
No current resource type dependencies
Resource dependencies to be added:
Resource dependency - 1: filesystem
1) Add Action Script.
2) Remove Action Script.
3) Add Type Specific Attribute.
4) Remove Type Specific Attribute.
5) Add Dependency.
6) Remove Dependency.
7) Show Current Information.
8) Cancel. (Aborts command)
9) Done. (Exits and runs command)
Enter option:9
Successfully defined resource_type newresourcetype
cmgr> show resource_types in cluster test
NFS
template
newresourcetype
statd
MAC_address
IP_address
filesystem
volume
cmgr> exit
# |