版本 日期 状态 修订人 摘要
V1.0 2018-04-17 创建 开源方案 初始版本


主机角色 IP地址 操作系统 摘要 域名
管理节点(Master) openshift-master1( CentOS Linux release 7.3.1611 (Core) x86_64 master + etcd + haproxy openshift.ops.com


[root@openshift-master1 /root]# yum install haproxy -y
  • 修改配置文件
[root@openshift-master1 /root]# vim /etc/haproxy/haproxy.cfg
# Global settings
    maxconn     20000
    log         /dev/log local0 info
    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    user        haproxy
    group       haproxy

    # turn on stats unix socket
    stats socket /var/lib/haproxy/stats

# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
    mode                    http
    log                     global
    option                  httplog
    option                  dontlognull
#    option http-server-close
    option forwardfor       except
    option                  redispatch
    retries                 3
    timeout http-request    10s
    timeout queue           1m
    timeout connect         10s
    timeout client          300s
    timeout server          300s
    timeout http-keep-alive 10s
    timeout check           10s
    maxconn                 20000

listen stats :9000
    mode http
    stats enable
    stats uri /

frontend  atomic-openshift-api
    bind *:443
    default_backend atomic-openshift-api
    mode tcp
    option tcplog

backend atomic-openshift-api
    balance source
    mode tcp
    server      master0 check
    server      master1 check
    server      master2 check

注意: 确保域名 openshift.ops.com 指向Haproxy (如没配置dns,请在各计算节点做hosts绑定)


systemctl enable haproxy
systemctl start haproxy