Forum Discussion
wayney_128269
Nimbostratus
Feb 28, 2005which method to enable disable server?
Hello,
Exactly, which method would I need to use to enable or disable a server from load balancing?
thanks
10 Replies
- Look at the LocalLB::PoolMember::set_session_enabled_state() method.
struct IPPortDefinition { String address; Long port; }; enum EnabledState { STATE_DISABLED = 0, // The object is disabled. STATE_ENABLED = 1 // The object is enabled. }; struct MemberSessionState { IPPortDefinition member EnabledState session_state }; void LocalLB::PoolMember::set_session_enabled_state( in String[] pool_names, in MemberSessionState[][] session_states );
You call this with an array of pools that you want to manipulate in the pool_names variable and then pass the members for each of the pools you want to change in the session_states variable.
If you want to disable all access to a given Node, you can can also set the session state at a global address level using the LocalLB::NodeAddress::set_session_enable_state() methodvoid LocalLB::NodeAddress::set_session_enabled_state( in String[] node_addresses, in EnabledState[] states );
-Joe - ameltzer_127050
Nimbostratus
I've been using LocalLBNodeAddress.set_session_enabled_state and it doesn't appear to do anything on the node. I inserted some debugging into my code to try to break down what it's doing:
lbNode.set_session_enabled_state( new string[] { "1.2.3.4" }, new LocalLB9.NodeAddress.CommonEnabledState[] { STATE_ENABLED }) )
After it's done, the 1.2.3.4 node's enabled_status continues to be ENABLED_STATUS_DISABLED. - Loc_Pham_101863Historic F5 AccountNodeAddress::set_session_enabled_state will set the configuration setting that allows new sessions to be established to the node addresses.
NodeAddress::get_session_enabled_state will retrieve the configuration setting that got set above.
However, to find out the effective session status of the node address after calling set_session_enabled_state, you'll have to call NodeAddress::get_session_status.
The same goes for LocalLB's Pool and PoolMember interfaces.
Loc - wayney_128269
Nimbostratus
How would I completely disable a node such that it does not take anymore connections?
thanks - wayney_128269
Nimbostratus
Also, what are the pros\cons of using LocalLB::NodeAddress::set_session_enable_state() over LocalLB::PoolMember::set_session_enabled_state() to enable\disable DIPs?
thanks - Loc_Pham_101863Historic F5 AccountTo disable a node address such that it will not take any new connection:
LocalLB.NodeAddress.set_session_enabled_state (Common.STATE_DISABLED)
Calling "set_session_enabled_state" on the PoolMember object will disable the specific pool member in a specific pool such that it will not accept any new connection. For example, if calling this method for member 10.10.10.100:80 in poolA, then member 10.10.10.100:80 in poolA will not accept any connection, but member 10.10.10.100:80 in poolB will still service connection as usual.
Calling "set_session_enabled_state" NodeAddress will effectively disable the node object listening on the IP address from accepting any connection. For example, calling this method for node address 10.10.10.100 will affect every pool member in every pool that is using 10.10.10.100 address. In the example above, members 10.10.10.100:80 in BOTH poolA and poolB will stop accepting new connections.
Loc - wayney_128269
Nimbostratus
So what method is used to take a node UP\DOWN?
thanks - Loc_Pham_101863Historic F5 AccountTo take the node address UP/DOWN, and therefore affecting all pool members using the same IP address:
LocalLB::NodeAddress::set_monitor_state
To take the specific pool members UP/DOWN:
LocalLB::PoolMember::set_monitor_state
Use get_monitor_status in each respective interface to get the effective monitor status.
Regards,
Loc - wayney_128269
Nimbostratus
ok, thanks for the quick reply. I'm a little confused about the up/down and enabled/disabled states for a node. Please clarify\explain the following situations a node can be in. I see four possible siuations a node can be in:
node1 up enabled
node1 up disabled
node1 down enabled
node1 down disabled
thanks
wayne - Loc_Pham_101863Historic F5 AccountNODE 10.10.10.100 UP SESSIONS ENABLED
=> The node is UP, currently accepting and handling connection requests, including existing/persistent and NEW connections.
NODE 10.10.10.100 UP SESSIONS DISABLED
=> The node is UP, no NEW connection requests will be accepted, but persistent connections will still be handled.
NODE 10.10.10.100 DOWN SESSIONS ENABLED or DISABLED
=> The node is DOWN (or even FORCED DOWN), no requests are serviced, even though new sessions are configured as enabled.
Loc
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
