RHCS6: Basic operations on clustered services

RHCS: Basic operations on clustered services

# Tested on RHEL 6

# On a cluster like following one:

root@mynodeA:/#> clustat
Cluster Status for mycluster @ Thu Sep 25 21:39:54 2014
Member Status: Quorate

 Member Name                                          ID   Status
 ------ ----                                         ---- ------
 mynodeA                                               1  Online, Local, rgmanager
 mynodeB                                               2  Online, rgmanager

 Service Name                                         Owner (Last)   State
 ------- ----                                         ----- ------   -----
 service:myservice-1                                      mynodeA    started
 service:myservice-2                                      mynodeA    started
 service:myservice-3                                      mynodeB    started



# Stop a service ('-d' for "disable")
# ------------------------------------------------------------------------------------------

root@mynodeA:/#> clusvcadm -d myservice-2

root@mynodeA:/#> clustat
Cluster Status for mycluster @ Thu Sep 25 21:40:22 2014
Member Status: Quorate

 Member Name                                          ID   Status
 ------ ----                                         ---- ------
 mynodeA                                               1  Online, Local, rgmanager
 mynodeB                                               2  Online, rgmanager

 Service Name                                         Owner (Last)   State
 ------- ----                                         ----- ------   -----
 service:myservice-1                                      mynodeA    started
 service:myservice-2                                     (mynodeA)   disabled
 service:myservice-3                                      mynodeB    started



# Start a stopped service ('-e' for "enable")
# ------------------------------------------------------------------------------------------

# To be able to start a service it has to be in 'disabled' status. Sometimes the service
# may be in 'failed' status (neither 'started' nor 'disabled'), what means that there has
# been a problem with the service. In those cases, after solving the problems that
# potentially prevent the service from starting, we should run once again stop command,
# "clusvcadm -d" on the service in order to pass it to 'disabled' status.

# Obviously, when starting a service, we have to indicate on which node we want to start
# it ('-m' parameter)

root@mynodeA:/#> clusvcadm -e myservice-2 -m mynodeB

root@mynodeA:/#> clustat
Cluster Status for mycluster @ Thu Sep 25 21:45:17 2014
Member Status: Quorate

 Member Name                                          ID   Status
 ------ ----                                         ---- ------
 mynodeA                                               1  Online, Local, rgmanager
 mynodeB                                               2  Online, rgmanager

 Service Name                                         Owner (Last)   State
 ------- ----                                         ----- ------   -----
 service:myservice-1                                      mynodeA    started
 service:myservice-2                                      mynodeB    started
 service:myservice-3                                      mynodeB    started

# If service was in 'failed' status, first pass it to 'disabled'

root@mynodeA:/#> clustat
Cluster Status for mycluster @ Thu Sep 25 21:43:21 2014
Member Status: Quorate

 Member Name                                          ID   Status
 ------ ----                                         ---- ------
 mynodeA                                               1  Online, Local, rgmanager
 mynodeB                                               2  Online, rgmanager

 Service Name                                         Owner (Last)   State
 ------- ----                                         ----- ------   -----
 service:myservice-1                                      mynodeA    started
 service:myservice-2                                     (mynodeA)   failed
 service:myservice-3                                      mynodeB    started


root@mynodeA:/#> clusvcadm -d myservice-2


root@mynodeA:/#> clustat
Cluster Status for mycluster @ Thu Sep 25 21:44:01 2014
Member Status: Quorate

 Member Name                                          ID   Status
 ------ ----                                         ---- ------
 mynodeA                                               1  Online, Local, rgmanager
 mynodeB                                               2  Online, rgmanager

 Service Name                                         Owner (Last)   State
 ------- ----                                         ----- ------   -----
 service:myservice-1                                      mynodeA    started
 service:myservice-2                                     (mynodeA)   disabled
 service:myservice-3                                      mynodeB    started



# Switch a service to a different node ('-r' for "relocate")
# ------------------------------------------------------------------------------------------

# When starting a service, we have to indicate on which node we want to start
# it ('-r' parameter)


root@mynodeA:/#> clustat
Cluster Status for mycluster @ Thu Sep 25 21:45:17 2014
Member Status: Quorate

 Member Name                                          ID   Status
 ------ ----                                         ---- ------
 mynodeA                                               1  Online, Local, rgmanager
 mynodeB                                               2  Online, rgmanager

 Service Name                                         Owner (Last)   State
 ------- ----                                         ----- ------   -----
 service:myservice-1                                      mynodeA    started
 service:myservice-2                                      mynodeB    started
 service:myservice-3                                      mynodeB    started


root@mynodeA:/#> clusvcadm -r myservice-2 -m mynodeA


root@mynodeA:/#> clustat
Cluster Status for mycluster @ Thu Sep 25 21:49:29 2014
Member Status: Quorate

 Member Name                                          ID   Status
 ------ ----                                         ---- ------
 mynodeA                                               1  Online, Local, rgmanager
 mynodeB                                               2  Online, rgmanager

 Service Name                                         Owner (Last)   State
 ------- ----                                         ----- ------   -----
 service:myservice-1                                      mynodeA    started
 service:myservice-2                                      mynodeA    started
 service:myservice-3                                      mynodeB    started
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Red Hat Enterprise Linux - Allow Root Login From a Specific IP Address Only
Viewed 1238 times since Wed, Oct 3, 2018
OEL 7 – How to disable IPv6 on Oracle Linux 7
Viewed 15818 times since Fri, Aug 3, 2018
RHEL: Rename a network interface on RHEL 7
Viewed 6867 times since Sat, Jun 2, 2018
Linux 16 Useful Bandwidth Monitoring Tools to Analyze Network Usage in Linux
Viewed 7615 times since Mon, Sep 21, 2020
How To Add Swap Space on Ubuntu 16.04
Viewed 1114 times since Fri, Jun 8, 2018
Learn Linux System Auditing with Auditd Tool on CentOS/RHEL
Viewed 1728 times since Fri, Apr 5, 2019
RHEL: Retrieve and generate a unique SCSI identifier
Viewed 1539 times since Sat, Jun 2, 2018
Linux Network (TCP) Performance Tuning with Sysctl
Viewed 7460 times since Fri, Aug 3, 2018
LVM: Reduce SWAP size by removing a Logical Volume
Viewed 1018 times since Sat, Jun 2, 2018
www.unixarena.com
Viewed 1133 times since Fri, Jul 27, 2018