RHCS Commands
# clusvcadm -R mysql-svc
restart mysql-svc on the current server
# clusvcadm -r mysql-svc -m <node>
relocates mysql-svc to a specific node
# clusvcadm -d mysql-svc
disables mysql-svc
# clusvcadm -e mysql-svc
enables mysql-svc
# clusvcadm -Z mysql-svc
freezes mysql-svc on the current node
# clusvcadm -U mysql-svc
unfreezes mysql-svc after it was frozen
# cman_tool status
shows information about the cluster
# gfs_tool df /mnt/gfsvol/
show information about the gfs file system
Common Files
/etc/cluster/cluster.conf
the main cluster configuration file
/etc/lvm/lvm.conf
the lvm configuration file
/usr/share/cluster/
the main directory of code used for cluster objects
/var/log/cluster/
the main logging directory
Checking status of the cluster:
# clustat
# clustat -m Display status of and exit
# clustat -s Display status of and exit
# clustat -l Use long format for services
# cman_tool status Show local record of cluster status
# cman_tool nodes Show local record of cluster nodes
# cman_tool nodes -af
# ccs_tool lsnode List nodes
# ccs_tool lsfence List fence devices
# group_tool displays the status of fence, dlm and gfs groups
# group_tool ls displays the list of groups and their membership
Resource Group Control Commands:
clusvcadm -d Disable
clusvcadm -e Enable
clusvcadm -e -F Enable according to failover domain rules
clusvcadm -e -m Enable on
clusvcadm -r -m Relocate to member>
clusvcadm -R Restart a group in place.
clusvcadm -s Stop
Resource Group Locking (for cluster Shutdown / Debugging):
clusvcadm -l Lock local resource group manager.
This prevents resource groups from
starting on the local node.
clusvcadm -S Show lock state
clusvcadm -Z Freeze group in place
clusvcadm -U Unfreeze/thaw group
clusvcadm -u Unlock local resource group manager.
This allows resource groups to start on the local node.
clusvcadm -c Convalesce (repair, fix) resource group.
Attempts to start failed, non-critical resources within a resource group.
###################################################################################################
Cluster Command Quick Reference
1)Cluster status
clustat Display the status of the cluster as viewed from the executing host
2)Cluster services administration
clusvcadm Manage services across the cluster.
3)Move a service to another node
clusvcadm –r -m
4)Stop a service
clusvcadm –d
5)Start a service
clusvcadm –e
6)Cluster configuration system
ccs_tool Online management of cluster configuration
7)Update the cluster.conf file across the cluster
ccs_tool update /etc/cluster/cluster.conf
8)Cluster Management
cman_tool Manage cluster nodes and display the current state of the cluster
9)Display status
cman_tool status
10)Fencing tools
11)Eject a node from the cluster
fence_node
12)Print fence debug messages
fence_tool dump
Case 1 : Enabling the service.
[root@Node1 ~]# clusvcadm -e service:IP_sg1
Local machine trying to enable service:IP_sg1…Success
service:IP_sg1 is now running on 192.168.111.150
Case 2 : Moving the service from one node to another node.
[root@Node2 ~]# clusvcadm -r service:IP_sg1 -m 192.168.111.150
Trying to relocate service:IP_sg1 to 192.168.111.150…Success
service:IP_sg1 is now running on 192.168.111.150
Case 3 : Disabling the service.
[root@Node1 ~]# clusvcadm -d service:IP_sg1
Local machine disabling service:IP_sg1…Success
Case 5 : Freezing the service.
[root@Node1 ~]# clusvcadm -Z service:IP_sg1
Local machine freezing service:IP_sg1…Success
Case 6 Unfreezing the service.
[root@Node1 ~]# clusvcadm -U service:IP_sg1
Local machine unfreezing service:IP_sg1…Success
Enable
Start the service, optionally on a preferred target and optionally according to failover domain rules. In the absence of either a preferred target or failover domain rules, the local host where clusvcadm is run will start the service. If the original start fails, the service behaves as though a relocate operation was requested (see Relocate in this table). If the operation succeeds, the service is placed in the started state.
clusvcadm -e <service_name> or clusvcadm -e <service_name> -m <member> (Using the -m option specifies the preferred target member on which to start the service.)
Disable
Stop the service and place into the disabled state. This is the only permissible operation when a service is in the failed state.
clusvcadm -d <service_name>
Relocate
Move the service to another node. Optionally, you may specify a preferred node to receive the service, but the inability of the service to run on that host (for example, if the service fails to start or the host is offline) does not prevent relocation, and another node is chosen. rgmanager attempts to start the service on every permissible node in the cluster. If no permissible target node in the cluster successfully starts the service, the relocation fails and the service is attempted to be restarted on the original owner. If the original owner cannot restart the service, the service is placed in the stopped state.
clusvcadm -r <service_name> or clusvcadm -r <service_name> -m <member> (Using the -m option specifies the preferred target member on which to start the service.)
Stop
Stop the service and place into the stopped state.
clusvcadm -s <service_name>
Freeze
Freeze a service on the node where it is currently running. This prevents status checks of the service as well as failover in the event the node fails or rgmanager is stopped. This can be used to suspend a service to allow maintenance of underlying resources. Refer to the section called “Considerations for Using the Freeze and Unfreeze Operations” for important information about using the freeze and unfreeze operations.
clusvcadm -Z <service_name>
Unfreeze
Unfreeze takes a service out of the freeze state. This re-enables status checks. Refer to the section called “Considerations for Using the Freeze and Unfreeze Operations” for important information about using the freeze and unfreeze operations.
clusvcadm -U <service_name>
Migrate
Migrate a virtual machine to another node. You must specify a target node. Depending on the failure, a failure to migrate may result with the virtual machine in the failed state or in the started state on the original owner.
clusvcadm -M <service_name> -m <member>
Important
For the migrate operation, you must specify a target node using the -m <member> option.
Restart
Restart a service on the node where it is currently running.
clusvcadm -R <service_name>
Convalesce
Convalesce (repair, fix) a resource group. Whenever a non-critical subtree's maximum restart threshold is exceeded, the subtree is stopped, and the service gains a P flag (partial), which is displayed in the output of the clustat command next to one of the cluster resource groups. The convalesce operation attempts to start failed, non-critical resources in a service group and clears the P flag if the failed, non-critical resources successfully start.
clusvcadm -c <service_name>
Considerations for Using the Freeze and Unfreeze Operations
Using the freeze operation allows maintenance of parts of rgmanager services. For example, if you have a database and a web server in one rgmanager service, you may freeze the rgmanager service, stop the database, perform maintenance, restart the database, and unfreeze the service.
When a service is frozen, it behaves as follows:
Status checks are disabled.
Start operations are disabled.
Stop operations are disabled.
Failover will not occur (even if you power off the service owner).
Important
Failure to follow these guidelines may result in resources being allocated on multiple hosts:
You must not stop all instances of rgmanager when a service is frozen unless you plan to reboot the hosts prior to restarting rgmanager.
You must not unfreeze a service until the reported owner of the service rejoins the cluster and restarts rgmanager.
==================================
Service Operation Description Command Syntax
Enable Start the service, optionally on a preferred target and optionally according to failover domain rules. In the absence of either a preferred target or failover domain rules, the local host where clusvcadm is run will start the service. If the original start fails, the service behaves as though a relocate operation was requested (see Relocate in this table). If the operation succeeds, the service is placed in the started state. clusvcadm -e <service_name> or clusvcadm -e <service_name> -m <member> (Using the -m option specifies the preferred target member on which to start the service.)
Disable Stop the service and place into the disabled state. This is the only permissible operation when a service is in the failed state. clusvcadm -d <service_name>
Relocate Move the service to another node. Optionally, you may specify a preferred node to receive the service, but the inability of the service to run on that host (for example, if the service fails to start or the host is offline) does not prevent relocation, and another node is chosen. rgmanager attempts to start the service on every permissible node in the cluster. If no permissible target node in the cluster successfully starts the service, the relocation fails and the service is attempted to be restarted on the original owner. If the original owner cannot restart the service, the service is placed in the stopped state. clusvcadm -r <service_name> or clusvcadm -r <service_name> -m <member> (Using the -m option specifies the preferred target member on which to start the service.)
Stop Stop the service and place into the stopped state. clusvcadm -s <service_name>
Freeze Freeze a service on the node where it is currently running. This prevents status checks of the service as well as failover in the event the node fails or rgmanager is stopped. This can be used to suspend a service to allow maintenance of underlying resources. Refer to the section called “Considerations for Using the Freeze and Unfreeze Operations” for important information about using the freeze and unfreeze operations. clusvcadm -Z <service_name>
Unfreeze Unfreeze takes a service out of the freeze state. This re-enables status checks. Refer to the section called “Considerations for Using the Freeze and Unfreeze Operations” for important information about using the freeze and unfreeze operations. clusvcadm -U <service_name>
Migrate Migrate a virtual machine to another node. You must specify a target node. Depending on the failure, a failure to migrate may result with the virtual machine in the failed state or in the started state on the original owner. clusvcadm -M <service_name> -m <member>
Important
For the migrate operation, you must specify a target node using the -m <member> option.
Restart Restart a service on the node where it is currently running. clusvcadm -R <service_name>
Convalesce Convalesce (repair, fix) a resource group. Whenever a non-critical subtree's maximum restart threshold is exceeded, the subtree is stopped, and the service gains a P flag (partial), which is displayed in the output of the clustat command next to one of the cluster resource groups. The convalesce operation attempts to start failed, non-critical resources in a service group and clears the P flag if the failed, non-critical resources successfully start. clusvcadm -c <service_name>
Last updated
Was this helpful?