OndrejHome.ha-cluster-pacemaker

ha-cluster-pacemaker

This guide helps you set up and manage a basic Pacemaker cluster on various Linux systems like CentOS, AlmaLinux, Rocky Linux, and Fedora.

What This Role Can Do

  • Enable necessary system repositories
  • Install required packages
  • Create users and groups for the Pacemaker cluster
  • Set up the firewall
  • Generate entries in /etc/hosts
  • Authorize cluster nodes
  • Create or expand a cluster (check allow_cluster_expansion)
    • Needs at least 2 nodes to start
    • Supports a single heartbeat with up to 8 links
    • Can involve remote nodes
    • Works with automatic or custom interfaces/IPs for heartbeat
  • Start the cluster on boot
  • Configure STONITH devices (fencing)
    • Installs fence_xvm by default
    • Optional configurations for fence_kdump, fence_vmware, and fence_aws

This role supports a --check mode for the default configuration and partially for other options.

Reporting Issues

If you encounter a problem, please provide:

  • Ansible version used
  • Operating System running Ansible
  • Playbook and inventory file that caused the error (remove sensitive info)
  • Error message or issue description

Requirements

  • Depends on the role: ondrejhome.pcs-modules-2.
  • Ansible version 2.8 or later (older versions may work but are not guaranteed).
  • For RHEL 6/7/8, machines must be registered. Access to 'High Availability' or 'Resilient Storage' repositories is enabled by default.

Role Variables

  • Define user for cluster nodes authorization:
    cluster_user: 'hacluster'
    
  • Define password for the cluster user:
    cluster_user_pass: 'testtest'
    
  • Define the cluster name:
    cluster_name: 'pacemaker'
    
  • Enable firewall configuration:
    cluster_firewall: true
    
  • Enable cluster to start on boot:
    cluster_enable_service: true
    

Fencing Device Configurations

  • Set options for configuring fencing devices like fence_xvm, fence_vmware, or fence_aws.
  • Choose how to map fencing devices to nodes, either one device per node or one device per cluster.

Security Recommendations

  • Always update cluster_user_pass to a secure value.
  • Use ansible-vault to encrypt sensitive variables. Create a separate file for these variables, then encrypt and include it in your playbook.

Example Playbooks

  1. Create a basic cluster:
    - hosts: cluster
      roles:
         - { role: 'ondrejhome.ha-cluster-pacemaker', cluster_name: 'test-cluster' }
    
  2. Create a cluster without the firewall:
    - hosts: cluster
      roles:
         - { role: 'ondrejhome.ha-cluster-pacemaker', cluster_name: 'test-cluster', cluster_firewall: false }
    

Inventory File Examples

Define your cluster nodes in an inventory file for proper configuration. Here’s a basic example for CentOS/RHEL:

[cluster]
192.168.22.21 vm_name=fastvm-centos-7
192.168.22.22 vm_name=fastvm-centos-7

License

This role is licensed under GPLv3.

Author Information

For inquiries or issues, contact the author at ondrej-xa2iel8u@famera.cz or raise an issue on GitHub.

Informazioni sul progetto

pacemaker basic cluster role with fencing configuration (xvm, kdump, custom)

Installa
ansible-galaxy install OndrejHome.ha-cluster-pacemaker
Licenza
gpl-3.0
Download
2.5k
Proprietario