VCS ON
RHEL6–CONFIGURE & OPERATION-P7
RESOURCES:
·
How to list the available resources
in vcs?
·
How to online/offline a resource in
vcs?
·
How to display the
attributes/parameters of a resource in vcs?
·
How to change the attribute value of
a resource in vcs?
·
How to show the state of a resource in
vcs?
·
How to list dependency of a resource
in vcs?
·
How to online/offline resources in
vcs?
·
How to Clearing a resource (automatically
initiates the online) in vcs?
·
How to probe a resource in vcs?
·
How to Offline a resource and
propagate the command to its children in vcs?
How to list the available resources…?
[root@pr01 ~]# hares –list
[root@pr01 ~]# hares -list -clus cluster1 |grep -i pr01
DG_Res
cluster1:dr01
DG_Res
cluster1:pr01
Mount_Res
cluster1:dr01
Mount_Res
cluster1:pr01
NFS_DG1
cluster1:dr01
NFS_DG1
cluster1:pr01
NFS_IP1
cluster1:dr01
NFS_IP1
cluster1:pr01
==============O/P Removed==========================================
How to show the state of a resource …?
[root@pr01 ~]# hares -state
#Resource Attribute System Value
DG_Res State dr01 OFFLINE
DG_Res State pr01 ONLINE
Mount_Res State dr01 OFFLINE
Mount_Res State pr01 ONLINE
NFS_DG1 State dr01 OFFLINE
NFS_DG1 State pr01 ONLINE
NFS_IP1 State dr01 OFFLINE
==============O/P Removed==========================================
How to display the attributes/parameters of a resource …?
[root@pr01 ~]# hares –display <for all available
resources>
[root@pr01 ~]# hares -display NFS_MOUNT1
#Resource Attribute System Value
NFS_MOUNT1 Group global NFS_APP1
NFS_MOUNT1 Type global Mount
NFS_MOUNT1 AutoStart global 1
NFS_MOUNT1 Critical global 1
NFS_MOUNT1 Enabled global 1
NFS_MOUNT1 LastOnline global pr01
NFS_MOUNT1 MonitorOnly global 0
==============O/P Removed==========================================
How to change the attribute value of a resource …?
First we need to identify the resource attribute, whose value needs
to be changed,
[root@pr01 ~]# hares –display
[root@pr01 ~]# hares -global DG_Res Critical 0
VCS WARNING V-16-1-11335 Configuration must be ReadWrite : Use haconf
-makerw
[root@pr01 ~]# hares -local DG_Res Critical
VCS WARNING V-16-1-11335 Configuration must be ReadWrite : Use haconf
–makerw
[root@pr01 ~]# haconf –makerw
[root@pr01 ~]# hares -modify Web_Res MonitorOnly 0
VCS WARNING V-16-1-10576 System-defined attributes may not be
modified
[root@pr01 ~]# hagrp -resources Web-App
Web_Res
DG_Res
Service_IP
Mount_Res
Nic_Res
Volume_Res
[root@pr01 ~]# hares -display DG_Res
#Resource Attribute System Value
DG_Res Group global Web-App
DG_Res Type global DiskGroup
DG_Res AutoStart global 1
DG_Res Critical global 0
DG_Res Enabled global 1
DG_Res LastOnline global pr01
==============O/P Removed==========================================
[root@pr01 ~]# hares -modify DG_Res Critical 0
[root@pr01 ~]# hares -display DG_Res |grep -i critical
DG_Res Critical global 0
[root@pr01 ~]# hares -modify DG_Res Critical 1
[root@pr01 ~]# hares -display DG_Res |grep -i critical
DG_Res Critical global 1
[root@pr01 ~]# hares -global DG_Res Critical 1
VCS WARNING V-16-1-10562 Value is already global.
[root@pr01 ~]# hares -local DG_Res Critical
VCS WARNING V-16-1-50153 Scope local not allowed for Critical
attribute of resource
[root@pr01 ~]# hares -global DG_Res Critical 0
VCS WARNING V-16-1-10562 Value is already global.
[root@pr01 ~]# hares -modify DG_Res Critical 0
[root@pr01 ~]# hares -display DG_Res |grep -i critical
DG_Res Critical global 0
How to list dependency of a resource …?
[root@pr01 ~]# hares -dep NFS_IP1
#Group Parent Child
NFS_APP1 NFS_IP1 NFS_NIC1
NFS_APP1 NFS_RESTART1
NFS_IP1
[root@pr01 ~]# hares -dep Web_Res
#Group Parent Child
Web-App Web_Res Service_IP
Web-App Web_Res Mount_Res
How to online/offline resources…?
ONLINE,
[root@pr01 ~]# hares -online -force Service_IP -sys
pr01
VCS WARNING V-16-1-51018 Unable to use the -force option for a
resource in a local group
[root@pr01 ~]# hares -online Service_IP -sys pr01
[root@pr01 ~]# hares -state Service_IP
#Resource Attribute System Value
Service_IP State dr01 OFFLINE
Service_IP State pr01 ONLINE
OFFLINE,
[root@pr01 ~]# hares -offline Service_IP -sys pr01
VCS WARNING V-16-1-10287 Online resources depend on resource
Service_IP. Take them offline first
[root@pr01 ~]# hares -offline -ignoreparent Service_IP
-sys pr01
[root@pr01 ~]# hares -state Service_IP
#Resource Attribute System Value
Service_IP State dr01 OFFLINE
Service_IP State pr01 OFFLINE
How to Clearing a resource (automatically initiates the online) …?
[root@pr01 ~]# hares -clear Service_IP -sys pr01
VCS WARNING V-16-1-10266 Resource not faulted on node pr01
[root@pr01 ~]# hares -clear Service_IP -sys dr01
VCS WARNING V-16-1-10266 Resource not faulted on node dr01
How to probe (Cause a resource agent to immediately monitor the
resource) a resource…?
[root@pr01 ~]# hares -probe Service_IP -sys dr01
How to Offline a resource and propagate the command to its children…?
[root@pr01 ~]# hares -offprop Volume_Res -sys pr01
VCS WARNING V-16-1-10287 Online resources depend on resource
Volume_Res. Take them offline first
[root@pr01 ~]# hares -offprop DG_Res -sys pr01
VCS WARNING V-16-1-10287 Online resources depend on resource DG_Res.
Take them offline first
Let’s check it with Web_Res
[root@pr01 ~]# hares -dep Web_Res
#Group Parent Child
Web-App Web_Res Service_IP
Web-App Web_Res Mount_Res
[root@pr01 ~]# hares -offprop Web_Res -sys pr01
[root@pr01 ~]# hares -state Web_Res
#Resource Attribute System Value
Web_Res State dr01 OFFLINE
Web_Res State pr01 OFFLINE
Check the status of dependency as well,
[root@pr01 ~]# hares -state Service_IP
#Resource Attribute System Value
Service_IP State dr01 OFFLINE
Service_IP State pr01
OFFLINE
[root@pr01 ~]# hares -state Mount_Res
#Resource Attribute System Value
Mount_Res State dr01 OFFLINE
Mount_Res State pr01 OFFLINE
Now it is offline everywhere,
[root@pr01 ~]# hagrp -state
#Group Attribute System Value
NFS_APP1 State dr01 |OFFLINE|
NFS_APP1 State pr01 |ONLINE|
Web-App State dr01 |OFFLINE|
Web-App State pr01 |OFFLINE|
Make it live,
[root@pr01 ~]# hagrp -online Web-App -sys pr01
[root@pr01 ~]# hagrp -state
#Group Attribute System Value
NFS_APP1 State dr01 |OFFLINE|
NFS_APP1 State pr01 |ONLINE|
Web-App State dr01 |OFFLINE|
Web-App State pr01 |ONLINE|
Reference & Good Read,
No comments:
Post a Comment