Friday, May 15, 2015

GFS cluster commands to manage database resources

We have few databases which Redhat's GFS to provide high availability.
Here are few commands to manage the cluster

1. To check the status of cluster

[root@host_dbs02 ~]# clustat
Cluster Status for host_dbsc1 @ Fri May 15 17:04:07 2015
Member Status: Quorate

 Member Name               ID   Status
 ------ ----               ---- ------
 host_dbs01_hb        1 Online, rgmanager
 host_dbs02_hb        2 Online, Local, rgmanager
 /dev/block/253:4     0 Online, Quorum Disk

 Service Name                     Owner (Last)       State
 ------- ----                     ----- ------       -----
 service:db1                  host_dbs02_hb      started    [Z]
 service:db2                   host_dbs01_hb      started    [Z]
 service:db3                 host_dbs02_hb      started    [Z]
 service:db4                 host_dbs01_hb      started    [Z]
 service:db5                  host_dbs02_hb      started    [Z]
 service:db6                  host_dbs01_hb      started    [Z]
 service:my_test_oracle           host_dbs02_hb      started    [Z]
 service:odb1                 host_dbs02_hb      started    [Z]
 service:odb2                 host_dbs02_hb      started    [Z]
 service:oracle_database          host_dbs02_hb      started    [Z]
 service:odb3                   host_dbs02_hb      started    [Z]

2.To freeze a service 
Freezing a service is means , no automatic fail over will happen for the resource.
This is best option when DBAs want to perform some maintenance on the database.
They can take any operation on the database as a stand alone database without considering about the cluster.

[root@host_dbs02 ~]# clusvcadm -Z dbname

Local machine freezing service:dssdevl1...Success

3.To unfreeze(thaw) a service

[root@host_dbs02 ~]# clusvcadm -U dbname

Local machine unfreezing service:odsdevl1...Success

4.To restart the service on the same node

[root@host_dbs02 ~]# clusvcadm -R dbname
Local machine trying to restart service:odssten1...

Success

5.To move the service to other node, 
-r is the obtion for the database/resource name and -m is for the destination node for the service

[root@host_dbs02 ~]# clusvcadm -r odssten1 -m host_dbs02_hb


6.Continusly check the status
This check the status of the cluster every 10 sec 

clustat -i 10

Other options


[root@host_dbs02 ~]# clusvcadm
usage: clusvcadm [command]

Resource Group Control Commands:
  -v                     Display version and exit
  -d <group>             Disable <group>.  This stops a group
                         until an administrator enables it again,
                         the cluster loses and regains quorum, or
                         an administrator-defined event script
                         explicitly enables it again.
  -e <group>             Enable <group>
  -e <group> -F          Enable <group> according to failover
                         domain rules (deprecated; always the
                         case when using central processing)
  -e <group> -m <member> Enable <group> on <member>
  -r <group> -m <member> Relocate <group> [to <member>]
                         Stops a group and starts it on another
                         cluster member.
  -M <group> -m <member> Migrate <group> to <member>
                         (e.g. for live migration of VMs)
  -q                     Quiet operation
  -R <group>             Restart a group in place.
  -s <group>             Stop <group>.  This temporarily stops
                         a group.  After the next group or
                         or cluster member transition, the group
                         will be restarted (if possible).
  -Z <group>             Freeze resource group.  This prevents
                         transitions and status checks, and is
                         useful if an administrator needs to
                         administer part of a service without
                         stopping the whole service.
  -U <group>             Unfreeze (thaw) resource group.  Restores
                         a group to normal operation.
  -c <group>             Convalesce (repair, fix) resource group.
                         Attempts to start failed, non-critical
                         resources within a resource group.
Resource Group Locking (for cluster Shutdown / Debugging):
  -l                     Lock local resource group managers.
                         This prevents resource groups from
                         starting.
  -S                     Show lock state
  -u                     Unlock resource group managers.

                         This allows resource groups to start.

No comments:

Post a Comment