【问题标题】:Internally load balance Docker Containers using Azure Container Service使用 Azure 容器服务对 Docker 容器进行内部负载平衡
【发布时间】:2016-06-28 10:39:43
【问题描述】:

我正在使用带有 Docker Swarm 的 Azure 容器服务来托管一些容器。这些容器正在运行 ASP.NET Core Web API,并公开了一个私有端口。我正在尝试使用 Haproxy 作为这些容器前面的内部负载均衡器,而这些容器又通过 Azure 容器服务上的端口 8080 公开。

这里是 haproxy.cfg

global
   log 127.0.0.1   local0
   log 127.0.0.1   local1 notice
   #log loghost    local0 info
   maxconn 4096
   chroot /usr/local/etc/haproxy
   uid 99
   gid 99

defaults
    mode http
    timeout connect 5000ms
    timeout client 50000ms
    timeout server 50000ms

frontend http-in
    bind *:8080
    default_backend servers

backend servers
    server server1 10.0.0.4:8080 maxconn 32
    server server1 10.0.0.5:8080 maxconn 32
    server server1 10.0.0.6:8080 maxconn 32

【问题讨论】:

  • Docker 1.12 在引擎中内置了 Swarm,并带有内部负载均衡器。这是一个候选版本,但可能值得一试?

标签: azure docker


【解决方案1】:

使用 Docker Swarm 作为编排器,ACS 已经在基于 swarm 的集群中创建了负载均衡器(分别用于代理和主控)。您不必再担心了。

在此处查看示例演示: "Microsoft Azure Container Service Engine - Swarm Walkthrough"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-03
    • 1970-01-01
    • 2018-10-14
    • 2012-05-24
    • 1970-01-01
    • 2011-09-18
    • 1970-01-01
    相关资源
    最近更新 更多