These are the basic commands to control a Red Hat Cluster from command line. View Cluster status, start/stop/restart/move resources and services, etc.
View Cluster Status
text
# clustat
Cluster Status for clstr-app @ Tue Jul 29 01:23:53 2014
Member Status: Quorate
Member Name ID Status
—— —- —- ——
nodo1 1 Online, Local, rgmanager
nodo2 2 Online, rgmanager
/dev/block/8:32 0 Online, Quorum Disk
Service Name Owner (Last) State
——- —- —– —— —–
service:fs_www nodo1 started
service:httpd nodo2 startedStart, stop and restart services
Start a service:
text
# clusvcadm -e httpd
Local machine trying to enable service:httpd…Successservice:httpd is now running on nodo1Stop a service:
text
# clusvcadm -d httpd
Local machine disabling service:httpd…SuccessRestart a service:
text
# clusvcadm -R httpdMove a service to another node in the Cluster
text
# clusvcadm -r httpd -m nodo2
Member nodo1 trying to enable service:httpd…Successservice:httpd is now running on nodo2Start and stop the cluster in an orderly manner
To remove a node from the cluster, the first thing we do is move all the services that it has active to another node in the cluster and then stop the corresponding processes in order:
text
# clusvcadm -r INSTANCIA -m NODO
# service rgmanager stop
# service clvmd stop
# service cman stopUnlock a resource
We check that the service is blocked
text
# clusvcadm -S service:httpd
Resource groups lockedWe unlock the resource
text
clusvcadm -u service:httpd
Resource groups unlockedOnce unlocked we can move the resource
text
clusvcadm -r httpd -m nodo02All the best.
:wq!
Comments