Red Hat Training

A Red Hat training course is available for RHEL 8

2.15. 配置负载均衡资源代理

创建健康探测后,您必须配置 负载均衡 资源代理。此资源代理运行一个服务,它回答来自 Azure 负载均衡器的健康探测请求,并删除不回答请求的集群节点。

流程

  1. 在所有节点上安装 nmap-ncat 资源代理。

    # yum install nmap-ncat resource-agents

    在单个节点上执行以下步骤。

  2. 创建 pcs 资源和组。将负载均衡器 FrontendIP 用于 IPaddr2 地址。

    # pcs resource create resource-name IPaddr2 ip="10.0.0.7" --group cluster-resources-group
  3. 配置 负载平衡 资源代理。

    # pcs resource create resource-loadbalancer-name azure-lb port=port-number --group cluster-resources-group

验证

  • 运行 pcs status 来查看结果。

    [root@node01 clouduser]# pcs status

    输出示例:

    Cluster name: clusterfence01
    Stack: corosync
    Current DC: node02 (version 1.1.16-12.el7_4.7-94ff4df) - partition with quorum
    Last updated: Tue Jan 30 12:42:35 2018
    Last change: Tue Jan 30 12:26:42 2018 by root via cibadmin on node01
    
    3 nodes configured
    3 resources configured
    
    Online: [ node01 node02 node03 ]
    
    Full list of resources:
    
    clusterfence (stonith:fence_azure_arm):      Started node01
    Resource Group: g_azure
        vip_azure  (ocf::heartbeat:IPaddr2):       Started node02
        lb_azure   (ocf::heartbeat:azure-lb):      Started node02
    
    Daemon Status:
      corosync: active/disabled
      pacemaker: active/disabled
      pcsd: active/enabled