4.12. 配置 HA 服务

在所有节点上完成以下步骤以配置 HA 服务。

步骤

  1. 在上一步中的 pcspacemaker 安装过程中,创建了用户 hacluster 。在所有群集节点上为用户 hacluster 创建密码。所有节点都使用相同的密码。

    # passwd hacluster
  2. 如果安装了 firewalld 服务,请添加 HA 服务。

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

    # systemctl start pcsd.service
    
    # systemctl enable pcsd.service
    
    Created symlink from /etc/systemd/system/multi-user.target.wants/pcsd.service to /usr/lib/systemd/system/pcsd.service.

验证

  1. 确保 pcsd 服务正在运行。

    # 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 Mon 2018-06-25 19:21:42 UTC; 15s ago
    Docs: man:pcsd(8)
    man:pcs(8)
    Main PID: 5901 (pcsd)
    CGroup: /system.slice/pcsd.service
    └─5901 /usr/bin/ruby /usr/lib/pcsd/pcsd > /dev/null &
  2. 编辑 /etc/hosts 文件。为所有节点添加 RHEL 主机名和内部 IP 地址。