Forum Discussion

Marc_13733's avatar
Marc_13733
Icon for Nimbostratus rankNimbostratus
Sep 19, 2013

Fallback to same server different port

We would like (for complicated reasons) to run 2 instances of the same service on the same server but on 2 different ports. Visitors vists www.mysite.com and F5 should reverse proxy server:8080 unless the service is unreachable in which case it should fallback to server:8081.

 

Load balancing doesn't help us as we don't want it to share the load between these endpoints, just failover to port 8081 if 8080 is stopped.

 

AFAIK we need to define 2 pools and then write an iRule which says: if 8080 not available then go to 8081.

 

We want this to be transparent to the client - no HTTP redirect.

 

Little help with the iRule code?

 

5 Replies

  • you can do it without an irule if you just have 2 servers on different ports.

     

    e.g. ip:8080, ip:8081 in the same pool.

     

    1. create a monitor to monitor the app.
    2. Use priority group, and assign the primary server a higher priority, e.g. 99, set the priority to 1 for the backup.

    give it a try and see if it works as you require.

     

    cheers

     

    • Marc_13733's avatar
      Marc_13733
      Icon for Nimbostratus rankNimbostratus
      That would work 99% of the time I guess. The thing is: we've put a sniffer (Fiddler) on :8080 (proxying to 8081) and want it to log 100% of requests. Just if it crashes (which it did yesterday) should F5 fallback to 8081. With the 99% solution we'd miss logging 1% of the traffic which we would like to avoid.
  • I believe JPV's idea is the way to go, and really boils down to the monitor you use. The monitor will determine if an application is available, and priority group activation will only send to the lower priority devices if the higher ones are marked down.

     

    we've put a sniffer (Fiddler) on :8080 (proxying to 8081)

     

    Not sure I understand this part.

     

  • See this link and search for the section on priority based member activation.

     

    http://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-concepts-11-4-0/5.html?sr=31994673

     

    Basically all traffic would go to the member with higher priority unless it goes down.

     

    thx

     

    • Marc_13733's avatar
      Marc_13733
      Icon for Nimbostratus rankNimbostratus
      Thanks again. According to that link "members that are assigned a high priority receive all traffic until the load reaches a certain level or some number of members in the group become unavailable". If I knew what "a certain level" meant... but I guess the "Priority group activation" applies - if set to 0 then traffic only fails over to lower (1) prio groups when *all* servers in high (99) prio groups are unavailable.