【问题标题】:Replacing Apache Camel with F5 to balance load on 4 web servers用 F5 替换 Apache Camel 以平衡 4 个 Web 服务器上的负载
【发布时间】:2016-06-02 15:32:41
【问题描述】:

请原谅我对 F5 及其实现的零知识。我们有 4 个 Web 服务器,我们希望在其上使用 F5 来分配负载。我们正在替换 Apache Camel 软件负载均衡器。

当前实施:

  1. 当客户发起交互并向 SW LB URL 发送 SOAP 请求时,每个客户端都会创建一个会话 ID。 http://Server1:7001/WebService

  2. SW 负载均衡器正在使用循环算法从以下 4 个目的地中找到合适的服务器,并创建服务器端点和会话 ID 的映射。 http://Server1:9080/WebService http://Server2:9080/WebService http://Server3:9080/WebService http://Server4:9080/WebService

  3. SW LB 将此会话保持 10 分钟。在这段时间内,如果再次请求相同的会话 ID,则使用相同的目标服务器来处理请求。因此,通过这种方式,如果用户与 Server2 有会话 - 此服务器将继续为他服务,直到用户结束会话(或会话超时)。

正如在 Server1 上所见,我们有负载均衡器 + Web 服务。我们正在取消 SW 负载均衡器以在 F5 上迁移。

以上方案可以在F5上实现吗? F5 会给我们一个新的 URL 吗?我们将与客户分享哪些接收请求?赞http://[new_IP_HW_LB]:[new_port]/WebService

它是否能够从传入的请求中提取会话 ID 并保持粘性会话映射?

【问题讨论】:

    标签: web-services load-balancing f5


    【解决方案1】:

    是的,您可以用 F5 替换 Apache Camel,而且您的设置非常标准。创建 4 个节点、一个有 4 个成员的池和虚拟服务器。

    F5 将需要一个新的 IP 地址 [URL],除非 Server1 放弃该地址。您还可以使用标准端口(HTTP 为 80,HTTPS 为 443)。

    最难的部分是 Session ID 的持久性。您需要创建一个具有 600 秒超时的通用持久性配置文件(本地流量 » 配置文件 » 持久性),并创建一个 iRule 以基于 XML 格式创建记录。 iRules 可能很棘手,但 DevCentral 社区已经有一个您可以适应的解决方案。

    DevCentral: how get response parameters 记入Stanislas。此 iRule 将捕获 <uid> XML 标记内的参数。

    when HTTP_RESPONSE {
      # Trigger collection for up to 1MB of data
      if {[HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{
        set content_length [HTTP::header "Content-Length"]
      } else {
          set content_length 1048576
      }
      # Check if $content_length is not set to 0
      if { ([HTTP::status] == 200) && ($content_length > 0)} {
        HTTP::collect $content_length
      }
    }
    
    when HTTP_RESPONSE_DATA {
        # do stuff with the payload
        #find the application unique identifier between <uid> and </uid> (5 is the length of <uid> string)
        persist add uie [string trim [findstr [HTTP::payload] "<uid>" 5 "</uid>"]]
    }
    
    when HTTP_REQUEST {
        persist uie [string trim [findstr [HTTP::payload] "<uid>" 5 "</uid>"]]
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-12
      • 2011-04-07
      • 2011-09-05
      • 2012-06-04
      • 2011-09-21
      • 1970-01-01
      • 2015-04-01
      • 2020-05-25
      相关资源
      最近更新 更多