7.5. 在新节点上配置 pacemaker 集群


先决条件

  • 您已在计划的集群节点上配置了 RHEL 高可用性存储库

流程

  1. 从 High Availability 存储库安装红帽高可用性附加组件软件包。选择您在现有节点上配置的隔离代理,并在新节点上执行安装:

    [root]# dnf install pcs pacemaker fence-agents-<model>
  2. 启动并启用 pcsd 服务:

    [root]# systemctl enable --now pcsd.service
  3. 可选:如果您正在运行 firewalld 服务,请启用红帽高可用性附加组件所需的端口:

    [root]# firewall-cmd --add-service=high-availability
    [root]# firewall-cmd --runtime-to-permanent
  4. 为用户 hacluster 设置密码:

    [root]# passwd hacluster
  5. 为现有集群中新节点验证用户 hacluster。在现有节点上运行,如 node1 :

    [root]# pcs host auth <node3>
    Username: hacluster
    Password:
    <node3>: Authorized
    • 输入带有或不使用 FQDN 的节点名称,如 /etc/hosts 文件中定义的。
    • 在提示符后输入 hacluster 用户密码。
  6. 在现有集群中添加新节点。这会同步节点之间的集群文件。在现有节点上运行,如 node1 :

    [root]# pcs cluster node add <node3>
    No addresses specified for host 'node3', using 'node3'
    Disabling sbd...
    node3: sbd disabled
    Sending 'corosync authkey', 'pacemaker authkey' to 'node3'
    node3: successful distribution of the file 'corosync authkey'
    node3: successful distribution of the file 'pacemaker authkey'
    Sending updated corosync.conf to nodes...
    node1: Succeeded
    node3: Succeeded
    node2: Succeeded
    node1: Corosync configuration reloaded
  7. 在新节点上启动集群。在新节点上运行,例如 node3:

    [root]# pcs cluster start
    Starting Cluster...
  8. 在系统引导时自动启动集群,这样可启用 corosyncpacemaker 服务。如果您希望在节点重启后手动控制集群的启动,请跳过这一步。在新节点上运行:

    [root]# pcs cluster enable

验证

  • 检查新节点是否可作为集群成员使用:

    [root]# pcs cluster status
    Cluster Status:
     Cluster Summary:
       * Stack: corosync (Pacemaker is running)
    …
       * 3 nodes configured
       * 7 resource instances configured
     Node List:
       * Online: [ node1 node2 node3 ]
    
    PCSD Status:
      node3: Online
      node2: Online
      node1: Online

后续步骤

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部