首页 文章

HAProxy多个前端/听众

提问于
浏览
1

我想使用一个HAProxy主机将来自多个前端/侦听器IP的流量定向到各自的后端 . 有没有办法在Debian / Centos主机上轻松完成此操作?

不使用dcoker或其他任何东西,只需安装haproxy即可将tcp连接卸载到多个其他服务器上 .
我读过的所有信息都指引我使用ACL,这将是极端的,因为我们有数千个域分布在多个'backend'服务器上,或者当然是' * '上的监听器 .

我们正在使用cisco交换机负载 balancer ,现在希望在VM中完成工作,可以轻松地消化对各种服务器的请求的监控,根据需要添加和删除资源 .

HAProxy启动正常,netstat -pln显示我们在负载均衡器中配置的每个IP上的服务 .

1 回答

  • 0

    解决方案非常简单:在基于debian的系统上:配置/ etc / network / interfaces文件以使用虚拟网络接口,例如:

    # The primary or physical network interface
    auto eth0
    allow-hotplug eth0
    iface eth0 inet static
            address 192.168.0.10
            netmask 255.255.255.0
            gateway 192.168.0.1
            dns-nameservers 8.8.8.8 8.8.4.4
    
    # first virtual interface
    auto eth0:0
    allow-hotplug eth0:0
    iface eth0:0 inet static
        address 192.168.0.11
        netmask 255.255.255.0
    
    # second virtual interface
    auto eth0:1
    allow-hotplug eth0:1
    iface eth0:1 inet static
        address 192.168.0.12
        netmask 255.255.255.0
    

相关问题