4.7. 安装高可用性软件包和代理

在所有节点上完成以下步骤,安装高可用性软件包和代理。

步骤

  1. 删除 AWS Red Hat Update Infrastructure (RHUI)客户端。

    $ sudo -i
    # dnf -y remove rh-amazon-rhui-client*
  2. 在红帽注册虚拟机。

    # subscription-manager register --auto-attach
  3. 禁用所有软件仓库。

    # subscription-manager repos --disable=*
  4. 启用 RHEL 9 服务器 HA 软件仓库。

    # subscription-manager repos --enable=rhel-9-for-x86_64-highavailability-rpms
  5. 更新 RHEL AWS 实例。

    # dnf update -y
  6. 安装红帽高可用性附加组件软件包,以及高可用性通道的所有可用的隔离代理。

    # dnf install pcs pacemaker fence-agents-aws
  7. 在上一步中的 pcspacemaker 安装过程中,创建了用户 hacluster 。在所有群集节点上为 hacluster 创建密码。所有节点都使用相同的密码。

    # passwd hacluster
  8. 如果安装了 firewalld.service,请在 RHEL Firewall 中添加 high availability 服务。

    # firewall-cmd --permanent --add-service=high-availability
    # firewall-cmd --reload
  9. 启动 pcs 服务,并使其在引导时启动。

    # systemctl start pcsd.service
    # systemctl enable pcsd.service
  10. 编辑 /etc/hosts ,并添加 RHEL 主机名和内部 IP 地址。详情请参阅如何在 RHEL 集群节点上设置 /etc/hosts 文件?

验证

  • 确保 pcs 服务正在运行。

    # systemctl status pcsd.service
    
    pcsd.service - PCS GUI and remote configuration interface
    Loaded: loaded (/usr/lib/systemd/system/pcsd.service; enabled; vendor preset: disabled)
    Active: active (running) since Thu 2018-03-01 14:53:28 UTC; 28min ago
    Docs: man:pcsd(8)
    man:pcs(8)
    Main PID: 5437 (pcsd)
    CGroup: /system.slice/pcsd.service
         └─5437 /usr/bin/ruby /usr/lib/pcsd/pcsd > /dev/null &
    Mar 01 14:53:27 ip-10-0-0-48.ec2.internal systemd[1]: Starting PCS GUI and remote configuration interface…
    Mar 01 14:53:28 ip-10-0-0-48.ec2.internal systemd[1]: Started PCS GUI and remote configuration interface.