# RHCS Mechanics ## Contents - [Acronyms](#acronyms) - [Configuration Files](#configuration-files) - [Filesystem Locations](#filesystem-locations) - [Operational Commands](#operational-commands) - [Cluster Components](#cluster-components) - [Operational Examples](#operational-examples) - [Configuration Validation](#configuration-validation) - [Status Check](#status-check) - [Service Manipulation](#service-manipulation) - [Configuration Examples](#configuration-examples) - [Standard LVM and PgSQL Initscript](#standard-lvm-and-pgsql-initscript) - [HA-LVM and MySQL Object](#ha-lvm-and-mysql-object) - [Standard LVM, MySQL script and NFS](#standard-lvm-mysql-script-and-nfs) - [HA-LVM and NFS Object](#ha-lvm-and-nfs-object) - [References](#references) ## Acronyms - **AIS**: Application Interface Specification - **AMF**: Availability Management Framework - **CCS**: Cluster Configuration System - **CLM**: Cluster Membership - **CLVM**: Cluster Logical Volume Manager - **CMAN**: Cluster Manager - **DLM**: Distributed Lock Manager - **GFS2**: Global File System 2 - **GNDB**: Global Network Block Device - **STONITH**: Shoot The Other Node In The Head - **TOTEM**: Group communication algorithm for reliable group messaging among cluster members ## Configuration Files - `/etc/cluster/cluster.conf` - The main cluster configuration file - `/etc/lvm/lvm.conf` - The LVM configuration file - typically `locking_type` and a `filter` are being configured here ## Filesystem Locations - `/usr/share/cluster/` - The main directory of code used for cluster objects | - `/var/log/cluster/` - The main logging directory (**RHEL6**) ## Operational Commands **Graphical Cluster Configuration** - `luci` - Cluster Management Web Interface primarily used with **RHEL6** - `system-config-cluster` - Cluster Management X11/Motif Interface primarily used with **RHEL5** **RGManager** - Resource Group Manager - `clustat` - Command used to display the status of the cluster, including node membership and services running - `clusvcadm` - Command used to manually enable, disable, relocate, and restart user services in a cluster - `rg_test` - Debug and test services and resource ordering **CCS** - Cluster Configuration System - `ccs_config_validate` - Verify a configuration; can validate the running config or a named file (**RHEL6**) - `ccs_config_dump` - Tool to generate XML output of running configuration (**RHEL6**) - `ccs_sync` - Synchronize the cluster configuration file to one or more machines in a cluster (**RHEL6**) - `ccs_update_schema` - Update the cluster relaxng schema that validates cluster.conf (**RHEL6**) - `ccs_test` - Diagnostic and testing command used to retrieve information from configuration files via **ccsd** - `ccs_tool` - Used to make online updates of CCS configuration files - **considered obsolete** **CMAN** - Cluster Manager - `cman_tool` - The administrative front end to CMAN, starts and stops CMAN infrastructure and can perform changes - `group_tool` - Used to get a list of groups related to fencing, DLM, GFS, and getting debug information - `fence_XXXX` - Fence agent for XXXX type of device- for example `fence_drac` (Dell DRAC), `fence_ipmilan` (IPMI) and `fence_ilo` (HP iLO) - `fence_check` - Test the fence configuration for each node in the cluster - `fence_node` - A program which performs I/O fencing on a single node - `fence_tool` - A program to join and leave the fence domain - `dlm_tool` - Utility for the `dlm` and `dlm_controld` daemon - `gfs_control` - Utility for the gfs\_controld daemon **GFS2** - Global File System 2 - `mkfs.gfs2` - Creates a GFS2 file system on a storage device - `mount.gfs2` - Mount a GFS2 file system; normally not used by the user directly - `fsck.gfs2` - Repair an unmounted GFS2 file system - `gfs2_grow` - Grows a mounted GFS2 file system - `gfs2_jadd` - Adds journals to a mounted GFS2 file system - `gfs2_quota` - Manage quotas on a mounted GFS2 file system - `gfs2_tool` - Configures, tunes and gather information on a GFS2 file system **Quorum Disk** - `mkqdisk` - Cluster Quorum Disk Utility ## Cluster Components **RGManager** - Resource Group Manager - `rgmanager` - Daemon used to handle user service requests including service start, service disable, service relocate, and service restart; **RHEL6** - `clurgmgrd` - Daemon used to handle user service requests including service start, service disable, service relocate, and service restart; **RHEL5** - `cpglockd` - Utilizes the extended virtual synchrony features of Corosync to implement a simplistic, distributed lock server for rgmanager **CLVM** - Cluster Logical Volume Manager - `clvmd` - The daemon that distributes LVM metadata updates around a cluster. Requires `cman` to be running first **CCS** - Cluster Configuration System - `ricci` - CCS daemon running on all cluster nodes and provides configuration file data to cluster software; **RHEL6** - `ccsd` - CCS daemon running on all cluster nodes and provides configuration file data to cluster software; **RHEL5** **CMAN** - Cluster Manager - `cman` - Cluster initscript used to start/stop all the CMAN daemons - `corosync` - Corosync cluster communications infrastructure daemon using TOTEM; **RHEL6** - `aisexec` - OpenAIS cluster communications infrastructure daemon using TOTEM; **RHEL5** - `fenced` - Fences cluster nodes that have failed (fencing generally means rebooting) - `dlm_controld` - Daemon that configures dlm according to cluster events - `gfs_controld` - Daemon that coordinates GFS mounts and recovery - `groupd` - Compatibility daemon for `fenced`, `dlm_controld` and `gfs_controld` - `qdiskd` - Talks to CMAN and provides a mechanism for determining node-fitness in a cluster environment - `cmannotifyd` - Talks to CMAN and provides a mechanism to notify external entities about cluster changes ## Operational Examples The man pages for `clustat` and `clusvcadm` contain more in-depth explanations of all the shown options; more options exist than are shown here. ### Configuration Validation As RHEL5 does not have the `ccs_config_validate` utility, an alternate method is possible to perform XML validation against the cluster schema instead: ``` xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf ``` The well-formatted XML file and a final message about validation should be printed out when run. ### Status Check Use the `clustat` command to check the cluster status: ``` # clustat Cluster Status for cluster1 @ Fri Jan 17 16:49:45 2014 Member Status: Quorate Member Name ID Status ------ ---- ---- ------ node1 1 Online, Local, rgmanager node2 2 Online, rgmanager Service Name Owner (Last) State ------- ---- ----- ------ ----- service:pgsql-svc node1 started ``` ### Service Manipulation Use the `clusvcadm` command to manipulate the services: ``` # Restart PostgreSQL in place on the same server clusvcadm -R pgsql-svc # Relocate PostgreSQL to a specific node clusvcadm -r pgsql-svc -m # Disable PostgreSQL clusvcadm -d pgsql-svc # Enable PostgreSQL clusvcadm -e pgsql-svc # Freeze PostgreSQL on the current node clusvcadm -Z pgsql-svc # Unfreeze PostgreSQL after it was frozen clusvcadm -U pgsql-svc ``` ## Configuration Examples ### Standard LVM and PgSQL Initscript This example uses a single standard LVM mount from SAN (as opposed to HA-LVM) and a normal initscript to start the service. An IP for a secondary backup network is included as well as the Dell DRAC fencing devices on the same VLAN. ``` /etc/hosts 127.0.0.1 localhost localhost.localdomain 10.11.12.10 pgdb1.example.com pgdb1 10.11.12.11 pgdb2.example.com pgdb2 10.11.12.20 pgdb1-drac 10.11.12.21 pgdb2-drac /etc/cluster/cluster.conf