====== Cluster Cheat Sheet ====== ===== Config files ===== * /etc/corosync/corosync.conf – config file for corosync cluster membership and quorum * /var/lib/pacemaker/crm/cib.xml – config file for cluster nodes and resources ==== Log files ==== * /var/log/cluster/corosync.log * /var/log/pacemaker.log * /var/log/pcsd/pcsd.log * /var/log/messages – used for some other services including crmd and pengine etc. ===== Resources and Resource Groups ===== A cluster resource refers to any object or service which is managed by the Pacemaker cluster. A number of different resources are defined by Pacemaker: | Primitive || this is the basic resource managed by the cluster | | Clone || a resource which can run on multiple nodes simultaneously | | MultiStake or Master/Slave || a resource in which one instance serves as master and the other as slave. A common example of this is DRBD | | Resource Group || this is a set of primitives or clone which is used to group resources together for easier admin | | Resource Classes | OCF or Open Cluster Framework | this is the most commonly used resource class for Pacemaker clusters | | | Service | used for implementing systemd, upstart, and lsb commands | | | Systemd | used for systemd commands | | | Fencing | used for Stonith fencing resources | | | Nagios | used for Nagios plugins | | | LSB or Linux Standard Base | these are for the older Linux init script operations. Now deprecated | | Resource stickiness || this refers to running a resource on the same cluster node even after some problem occurs with the node which is later rectified. This is advised since migrating resources to other nodes should generally be avoided | ===== Constraints ===== A set of rules that sets out how resources or resource groups should be started. Constraint Types: | Location | defines on which node a resource should run – or not run, if the priority is set to minus -INFINITY | | Colocation | defines which resources should be started together – or not started together in the case of -INFINITY | | Order | defines in which order resources should be started. This is to allow for pre-conditional services to be started first | ==== Resource Order Priority Scores ==== These are used with the constraint types above. The priority score can be set to a value between -1,000,000 (-INFINITY = the event will never happen) right up to INFINITY (1,000,000 = the event must happen). Any negative priority score will prevent the resource from running. ===== Cluster Admin Commands ===== On RedHat Pacemaker Clusters, the pcs command is used to manage the cluster. pcs stands for “Pacemaker Configuration System”: pcs status – View cluster status. pcs config – View and manage cluster configuration. pcs cluster – Configure cluster options and nodes. pcs resource – Manage cluster resources. pcs stonith – Manage fence devices. pcs constraint – Manage resource constraints. pcs property – Manage pacemaker properties. pcs node – Manage cluster nodes. pcs quorum – Manage cluster quorum settings. pcs alert – Manage pacemaker alerts. pcs pcsd – Manage pcs daemon. pcs acl – Manage pacemaker access control lists. ===== Installation ===== To install packages: yum install pcs -y yum install fence-agents-all -y echo CHANGE_ME | passwd –stdin hacluster systemctl start pcsd systemctl enable pcsd ===== Authenticate new nodes ===== pcs cluster auth \ node1.example.com node2.example.com node3.example.com Username: hacluster Password: node1.example.com: Authorized node2.example.com: Authorized node3.example.com: Authorized ===== create and start a new cluster ===== pcs cluster setup