- Customizing the Hash Algorithm for Persistence across Virtual Servers
- Configuring the Redirection Mode
- Configuring per-VLAN Wildcarded Virtual Servers
- Assigning Weights to Services
- Configuring the MySQL and Microsoft SQL Server Version Setting
The NetScaler appliance uses hash-based algorithms for maintaining persistence across virtual servers. By default, the hash-based load balancing method uses a hash value of the IP address and port number of the service. If a service is made available at different ports on the same server, the algorithm generates different hash values. Therefore, different load balancing virtual servers might send requests for the same application to different services, breaking the pseudo-persistence.
As an alternative to using the port number to generate the hash value, you can specify a unique hash identifier for each service. For a service, the same hash identifier value must be specified on all the virtual servers. If a physical server serves more than one type of application, each application type should have a unique hash identifier.
The algorithm for computing the hash value for a service works as follows:
You can also specify hash identifiers when using the NetScaler command line to bind services to a service group. In the configuration utility, you can open a service group and add hash identifiers on the Members tab.
At the command prompt, type:
set lb parameter -usePortForHashLb (YES | NO)
> set lb parameter -usePortForHashLb NO Done >show lb parameter Global LB parameters: Persistence Cookie HttpOnly Flag: DISABLED Use port for hash LB: NO Done
At the command prompt, type the following commands to set the hash ID and verify the setting:
add service < name > (< ip > |< serverName >) < serviceType > < port > -hashId < positive_integer >
show service <name>
Example
> add service flbkng 10.101.10.1 http 80 -hashId 12345 Done >show service flbkng flbkng (10.101.10.1:80) - HTTP State: DOWN Last state change was at Thu Nov 4 10:14:52 2010 Time since last state change: 0 days, 00:00:15.990 Server Name: 10.101.10.1 Server ID : 0 Monitor Threshold : 0 Down state flush: ENABLED Hash Id: 12345 1) Monitor Name: tcp-default State: DOWN Weight: 1 Done
Type the set service command, the name of the service, and -hashID followed by the ID value.
To specify a hash identifier for each member to be added to the group and verify the setting, at the command prompt, type the following commands (Be sure to specify a unique hashID for each member.):
bind servicegroup <serviceGroupName> <memberName> <port> -hashId <positive_integer>
show servicegroup <serviceGroupName>
Example
bind servicegroup http_svc_group 10.102.27.153 80 -hashId 2222222 >show servicegroup SRV SRV - HTTP State: ENABLED Monitor Threshold : 0 … 1) 1.1.1.1:80 State: DOWN Server Name: 1.1.1.1 Server ID: 123 Weight: 1 Hash Id: 32211 Monitor Name: tcp-default State: DOWN … 2) 2.2.2.2:80 State: DOWN Server Name: 2.2.2.2 Server ID: 123 Weight: 1 Hash Id: 12345 Monitor Name: tcp-default State: DOWN … Done