Forum Discussion
Kamalpreet_1068
Nimbostratus
Aug 29, 2012Node health checkup
Hi ,
I have developed a IRULe which is forwarding a request between 2 nodes and also changing the host header values. Request is toggling between 2 nodes irespective of the health of nodes.
I want to add a additional condition here something like if a node is up only then it should forward a traffic.
because now what happening is even if my one server is down it is forwarding the request to that server and connection breaks.
when RULE_INIT {
set ::whichone 0
}
when HTTP_REQUEST {
switch $::whichone {
0 {
HTTP::header replace "Host" "xsp.pac.com:8100"
use node 10.206.134.23
}
1 {
HTTP::header replace "Host" "abc.pac.com:8100"
use node 10.206.134.24
}
}
set ::whichone [expr ! $::whichone]
}
1 Reply
- hoolio
Cirrostratus
Hi Kamalpreet,
I think you can use round robin load balancing to a pool of the two hosts that has a monitor configured. If you need to rewrite the host header you can use an iRule like this:
https://devcentral.f5.com/wiki/iRules.rewrite_host_header_to_server_name.ashx
Using a global variable as you have will demote the virtual server from running on more than one CPU core:
https://devcentral.f5.com/wiki/iRules.CMPCompatibility.ashx
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects