Forum Discussion

Daniel_Vu_10371's avatar
Daniel_Vu_10371
Icon for Nimbostratus rankNimbostratus
Mar 16, 2007

How do I test to see which node from the pool

We have setup a testpool with 2 nodes

 

node-1 ip address is 172.16.1.12

 

node-2 ip address is 172.16.1.14

 

node-3 ip address is 172.16.1.16

 

 

We also setup a virtual server (ip = 172.16.1.5) so

 

our user can access through the browser that will

 

redirect to s specific url from one of the nodes created above. My question is how do I test the node

 

from the testpool so we can redirect to the specific url.

 

 

Can someone please explain to me what happened when the users hit http://172.16.1.5/ url

 

and how do I test which value from the testpool?

 

 

 

Thanks,

 

 

5 Replies

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    I'm not sure I understand what you're asking. Are you saying you want to direct traffic to a specific node in your pool based on what the url is given by the client?

     

     

    Colin
  • Ken_Wong_48678's avatar
    Ken_Wong_48678
    Historic F5 Account
    Yes, I also want to know how direct traffic to a specific node in a pool based on what the url is. What command should I use for the node selection. Thanks!

     

     

    Ken
  • 
    when HTTP_REQUEST {
      if { [string tolower [HTTP::uri]] starts_with "/node-1" } {
        use pool  member 172.16.1.12
      } elseif { [string tolower [HTTP::uri]] starts_with "/node-2" } {
          use pool  member 172.16.1.14
      } elseif { [string tolower [HTTP::uri]] starts_with "/node-3" } {
          use pool  member 172.16.1.16
      }
    }

    So if your request began http://172.16.1.5/node-1/, you would select 172.16.1.12...

  • you'll probably want to strip that /node-$x out before passing onto the server, unless that is a valid path...
  • Unfortunately there isn't a way to specify members outside of specifying their address and ports.

     

     

    You could store the values in a Data Group to basically name your own members and look them up with findstr (search the forums or the documentation for findstr to get some examples. The downside to this approach is that you'll have to make sure the data groups are in sync with your configuration.

     

     

    -Joe