Priority order for GSLB services
-
Bind a service to a GSLB virtual server.
-
Bind a service group to a GSLB virtual server.
-
Bind a service group member to the GSLB service group.
-
Configuring a backup virtual server chain: The number of configuration lines is high, and you must run the
showcommand several times to know the state of all the GSLB services for each virtual server. -
Configuring the preferred location: You must create location entries for all your application endpoints.
Configure priority order for GSLB services
-order <number> parameter is added to the bind commands.
bind gslb vserver <vservername> -servicename/servicegroupname <servicename/servicegroupname> -order <number>
- order <number> parameter, you can prioritize the order of selection of services as follows:
-
Set 1 (s1, s2) bound to gv1 – order 1
-
Set 2 (s3, s4) bound to gv1 – order 2
-
Set 3 (s5, s6) bound to gv1 – order 3
-
The virtual server (gv1) selects the services in set 1 (s1 and s2) with order number 1, because this set is assigned the lowest order number. By default, the lowest order number has the highest priority.
-
If all the services in set 1 are DOWN, gv1 selects set 2 (s3 and s4) with order number 2.
-
If all the services in set 1 and set 2 are down, gv1 selects set 3 (s5 and s6) with order number 3.
Configure priority order for GSLB services using the CLI
-
Add GSLB sites.
add gslb site site1 1.1.1.1add gslb site site2 1.1.1.2 -
Add a GSLB virtual server.
add gslb vserver gv1 HTTP -
Add GSLB services.
add gslb service gsvc1 1.1.1.3 http 80 -sitename site1add gslb service gsvc2 1.1.1.4 http 80 -sitename site2add gslb service gsvc3 1.1.1.5 http 80 -sitename site1add gslb service gsvc4 1.1.1.6 http 80 -sitename site2add gslb service gsvc5 1.1.1.7 http 80 -sitename site1add gslb service gsvc6 1.1.1.8 http 80 -sitename site2 -
Set the order number and bind the services to the GSLB virtual server.
bind gslb vserver gv1 gsvc1 -order 1bind gslb vserver gv1 gsvc2 -order 1bind gslb vserver gv1 gsvc3 -order 2bind gslb vserver gv1 gsvc4 -order 2bind gslb vserver gv1 gsvc5 -order 3bind gslb vserver gv1 gsvc6 -order 3
Configure priority order for GSLB services using the GUI
-
You have created GSLB sites.
-
You have created a GSLB virtual server.
-
You have created GSLB services.
-
Navigate to Traffic Management > GSLB > Virtual Servers and double-click the GSLB virtual server.
-
In GSLB Virtual Server, under the GSLB Services and GSLB Service Group Binding section, click GSLB Virtual Server to GSLB Service Bindings.
-
In the GSLB Services and GSLB Service Group Binding dialog, click Add Binding.
-
In the GSLB Service Binding dialog box, select a service.
-
Type a number in the Order field to set the priority order for the service.Configure priority order and bind GSLB service
-
Click Bind.
-
Repeat steps 1–6 to configure different priority order number for different services.
Configure priority order for GSLB services using LB policy commands
- order <number> parameter, you have configured the priority order for services as follows:
-
Set 1 (s1, s2) bound to gv1 – order 1
-
Set 2 (s3, s4) bound to gv1 – order 2
-
Set 3 (s5, s6) bound to gv1 – order 3
LB action
add lb action <name> <type> <string>
add lb action act1 -type SELECTIONORDER -value 3 2 1
-
name: Name of the action. -
type: Type of action. -
string: Value for the specified action.
LB policy
add lb policy <name> <rule> <action> <undefaction>
add lb policy pol1 -rule CLIENT.IP.SRC.EQ(8.8.8.8) -action act1
-
name: Name of the policy. -
rule: A rule consists of one or more expressions. The rule is associated with an action, which is performed if the request matches the rule. -
action: DROP, NOLBACTION, and RESET are supported. -
undefaction: The NetScaler appliance generates an undefined event (UNDEF event) when a request does not match a policy. You can use theset lb param -undefAction <action>command to set the undefined action. You can assign these actions to an undefined event: DROP, NOLBACTION, and RESET.
add lb action act1 -type SELECTIONORDER -value 3 1 2
add lb policy pol1 -rule CLIENT.IP.SRC.EQ(8.8.8.8) -action act1
bind gslb vserver gv1 -policyName pol1 -priority 20 - gotoPriorityExpression END -type REQUEST
8.8.8.8, and sends that traffic to gv1. The LB action type (SELECTIONORDER) defines the service selection order. After you bind the LB policy to gv1, and when gv1 receives the client traffic from the IP address 8.8.8.8, the services are selected in the following order:
-
The virtual server (gv1) selects services in set 3 (s5 and s6) with priority order 3.
-
If all the services in set 3 are DOWN, gv1 selects set 1 (s1 and s2) with priority order 2.
-
If all the services in set 3 and set 2 are down, the gv1 selects set 1 (s1 and s2) with order 1.
Configure priority order for GSLB services with LB policy commands using the CLI
-
Add an LB action.
add lb action act1 -type SELECTIONORDER -value 3 1 2 -
Add an LB policy.
add lb policy pol1 -rule CLIENT.IP.SRC.EQ(8.8.8.8) -action act1 -
Add GSLB sites.
add gslb site site1 1.1.1.1add gslb site site2 1.1.1.2 -
Add a GSLB virtual server.
add gslb vserver gv1 HTTP -
Bind the LB policy to the GSLB virtual server.
bind gslb vserver gv1 -policyName pol1 -priority 20 - gotoPriorityExpression END -type REQUEST -
Add GSLB services.
add gslb service gsvc1 1.1.1.3 http 80 -sitename site1add gslb service gsvc2 1.1.1.4 http 80 -sitename site2add gslb service gsvc3 1.1.1.5 http 80 -sitename site1add gslb service gsvc4 1.1.1.6 http 80 -sitename site2add gslb service gsvc5 1.1.1.7 http 80 -sitename site1add gslb service gsvc6 1.1.1.8 http 80 -sitename site2 -
Set the order and bind the services to the GSLB virtual server.
bind gslb vserver gv1 gsvc1 -order 1bind gslb vserver gv1 gsvc2 -order 1bind gslb vserver gv1 gsvc3 -order 2bind gslb vserver gv1 gsvc4 -order 2bind gslb vserver gv1 gsvc5 -order 3bind gslb vserver gv1 gsvc6 -order 3
Configure priority order for GSLB services with the LB policy commands using the GUI
-
You have created GSLB sites.
-
You have created a GSLB virtual server.
-
You have created services.
-
Navigate to AppExpert > LB > Actions.
-
In LB Actions, click Add.
-
In the Create LB Actions dialog box, specify values for the following parameters:
-
Action Name
-
Type
-
ValueNote:The numbers in the Value field are separated by a space.
-
-
Click Create.
-
Navigate to AppExpert > LB > Policies.
-
In LB Policies, click Add.
-
In the Create LB Policies dialog box, specify values for the following parameters:
-
Name: pol1
-
Action: act1
-
Undefined-Result Action: NOLBACTION
-
Expression: CLIENT.IP.SRC.EQ(8.8.8.8)
Add LB policy -
-
Click Create.
-
Navigate to Traffic Management >GSLB > Virtual Servers and double-click the GSLB virtual server.
-
In GSLB Virtual Server, under the Advanced Settings section, click Policies.
-
In the Policies section, click GSLB Virtual Server LB Policy Binding.
-
In the Policy Binding dialog box, specify values for the following parameters:
-
Select Policy: pol 1
-
Priority: 10
-
Goto Expression: END
Bind LB policy -
-
Click Bind.
Persistence settings for services
set gslb param -overridePersistencyforOrder<YES/NO>
-
Set 1 (s1, s2) bound to gv1 – order 1
-
Set 2 (s3, s4) bound to gv1 – order 2
set gslb parameter -overridePersistencyforOrder YES
Priority toggle
-
set gslb vserver –toggleorder <Ascending/Descending> -
set gslb vserver v1 -orderthreshold 80
-
Service 1- order 0
-
Service 2 – order 1
set gslb vserver –toggleorder Descending