-
Getting Started with NetScaler
-
Deploy a NetScaler VPX instance
-
Optimize NetScaler VPX performance on VMware ESX, Linux KVM, and Citrix Hypervisors
-
Apply NetScaler VPX configurations at the first boot of the NetScaler appliance in cloud
-
Configure simultaneous multithreading for NetScaler VPX on public clouds
-
Install a NetScaler VPX instance on Microsoft Hyper-V servers
-
Install a NetScaler VPX instance on Linux-KVM platform
-
Prerequisites for installing NetScaler VPX virtual appliances on Linux-KVM platform
-
Provisioning the NetScaler virtual appliance by using OpenStack
-
Provisioning the NetScaler virtual appliance by using the Virtual Machine Manager
-
Configuring NetScaler virtual appliances to use SR-IOV network interface
-
Configure a NetScaler VPX on KVM hypervisor to use Intel QAT for SSL acceleration in SR-IOV mode
-
Configuring NetScaler virtual appliances to use PCI Passthrough network interface
-
Provisioning the NetScaler virtual appliance by using the virsh Program
-
Provisioning the NetScaler virtual appliance with SR-IOV on OpenStack
-
Configuring a NetScaler VPX instance on KVM to use OVS DPDK-Based host interfaces
-
-
Deploy a NetScaler VPX instance on AWS
-
Deploy a VPX high-availability pair with elastic IP addresses across different AWS zones
-
Deploy a VPX high-availability pair with private IP addresses across different AWS zones
-
Protect AWS API Gateway using the NetScaler Web Application Firewall
-
Configure a NetScaler VPX instance to use SR-IOV network interface
-
Configure a NetScaler VPX instance to use Enhanced Networking with AWS ENA
-
Deploy a NetScaler VPX instance on Microsoft Azure
-
Network architecture for NetScaler VPX instances on Microsoft Azure
-
Configure multiple IP addresses for a NetScaler VPX standalone instance
-
Configure a high-availability setup with multiple IP addresses and NICs
-
Configure a high-availability setup with multiple IP addresses and NICs by using PowerShell commands
-
Deploy a NetScaler high-availability pair on Azure with ALB in the floating IP-disabled mode
-
Configure a NetScaler VPX instance to use Azure accelerated networking
-
Configure HA-INC nodes by using the NetScaler high availability template with Azure ILB
-
Configure a high-availability setup with Azure external and internal load balancers simultaneously
-
Configure a NetScaler VPX standalone instance on Azure VMware solution
-
Configure a NetScaler VPX high availability setup on Azure VMware solution
-
Configure address pools (IIP) for a NetScaler Gateway appliance
-
Deploy a NetScaler VPX instance on Google Cloud Platform
-
Deploy a VPX high-availability pair on Google Cloud Platform
-
Deploy a VPX high-availability pair with external static IP address on Google Cloud Platform
-
Deploy a single NIC VPX high-availability pair with private IP address on Google Cloud Platform
-
Deploy a VPX high-availability pair with private IP addresses on Google Cloud Platform
-
Install a NetScaler VPX instance on Google Cloud VMware Engine
-
-
Solutions for Telecom Service Providers
-
Load Balance Control-Plane Traffic that is based on Diameter, SIP, and SMPP Protocols
-
Provide Subscriber Load Distribution Using GSLB Across Core-Networks of a Telecom Service Provider
-
Authentication, authorization, and auditing application traffic
-
Basic components of authentication, authorization, and auditing configuration
-
Web Application Firewall protection for VPN virtual servers and authentication virtual servers
-
On-premises NetScaler Gateway as an identity provider to Citrix Cloud
-
Authentication, authorization, and auditing configuration for commonly used protocols
-
Troubleshoot authentication and authorization related issues
-
-
-
-
-
-
Use Case 1: Configure DataStream for a primary/secondary database architecture
-
Use Case 2: Configure the token method of load balancing for DataStream
-
Use Case 4: Database specific load balancing
-
-
Configure DNS resource records
-
Configure NetScaler as a non-validating security aware stub-resolver
-
Jumbo frames support for DNS to handle responses of large sizes
-
Caching of EDNS0 client subnet data when the NetScaler appliance is in proxy mode
-
Use case - configure the automatic DNSSEC key management feature
-
Use Case - configure the automatic DNSSEC key management on GSLB deployment
-
-
-
Persistence and persistent connections
-
Advanced load balancing settings
-
Gradually stepping up the load on a new service with virtual server–level slow start
-
Protect applications on protected servers against traffic surges
-
Retrieve location details from user IP address using geolocation database
-
Use source IP address of the client when connecting to the server
-
Use client source IP address for backend communication in a v4-v6 load balancing configuration
-
Set a limit on number of requests per connection to the server
-
Configure automatic state transition based on percentage health of bound services
-
-
Use case 2: Configure rule based persistence based on a name-value pair in a TCP byte stream
-
Use case 3: Configure load balancing in direct server return mode
-
Use case 6: Configure load balancing in DSR mode for IPv6 networks by using the TOS field
-
Use case 7: Configure load balancing in DSR mode by using IP Over IP
-
Use case 10: Load balancing of intrusion detection system servers
-
Use case 11: Isolating network traffic using listen policies
-
Use case 12: Configure Citrix Virtual Desktops for load balancing
-
Use case 13: Configure Citrix Virtual Apps and Desktops for load balancing
-
Use case 14: ShareFile wizard for load balancing Citrix ShareFile
-
Use case 15: Configure layer 4 load balancing on the NetScaler appliance
-
-
-
-
-
Authentication and authorization for System Users
-
-
-
Configuring a CloudBridge Connector Tunnel between two Datacenters
-
Configuring CloudBridge Connector between Datacenter and AWS Cloud
-
Configuring a CloudBridge Connector Tunnel Between a Datacenter and Azure Cloud
-
Configuring CloudBridge Connector Tunnel between Datacenter and SoftLayer Enterprise Cloud
-
Configuring a CloudBridge Connector Tunnel Between a NetScaler Appliance and Cisco IOS Device
-
CloudBridge Connector Tunnel Diagnostics and Troubleshooting
This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已经过机器动态翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
이 콘텐츠는 동적으로 기계 번역되었습니다. 책임 부인
Este texto foi traduzido automaticamente. (Aviso legal)
Questo contenuto è stato tradotto dinamicamente con traduzione automatica.(Esclusione di responsabilità))
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.책임 부인
Este artigo foi traduzido automaticamente.(Aviso legal)
这篇文章已经过机器翻译.放弃
Questo articolo è stato tradotto automaticamente.(Esclusione di responsabilità))
Translation failed!
Use Case 4: Database specific load balancing
A database server farm must be load balanced not only based on the states of the servers, but also based on the availability of the database on each server. A service might be up, and a load balancing device might show it as being in the UP state, but the requested database might be unavailable on that service. The request isn’t served if a query is forwarded to a service on which the database in unavailable. Therefore, a load balancing device must be aware of the availability of a database on each service. And when making a load balancing decision, it must consider only those services on which the database is available.
As an example, consider that database servers server1, server2, and server3 host databases mydatabase1 and mydatabase2. If mydatabase1 becomes unavailable on server2, the load balancing device must be aware of that change in state. It must load balance requests for mydatabase1 across only server1 and server3. After mydatabase1 becomes available on server2, the load balancing device must include server2 in load balancing decisions. Similarly, if mydatabase2 becomes unavailable on server3, the device must load balance requests for mydatabase2 across only server1 and server2. It must include server3 in its load balancing decisions only when mydatabase2 becomes available. This load balancing behavior must be consistent across all the databases that are hosted on the server farm.
The NetScaler appliance implements this behavior by retrieving a list of all the databases that are active on a service. To retrieve the list of active databases, the appliance uses a monitor that is configured with an appropriate SQL query. If the requested database is unavailable on a service, the appliance excludes the service from load balancing decisions until it becomes available. This behavior ensures uninterrupted service to clients.
Note
Database specific load balancing is supported for only MS SQL and MySQL service types. This support is also available for MS SQL Server configured in Always On high availability groups. For more information, see Supported database versions, protocols, and authentication methods.
To set up database specific load balancing, you must configure the following:
- Enable the load balancing feature, and configure a load balancing virtual server of type MSSQL or MySQL.
- Configure the services that host the database, and bind the services to the virtual server. The monitor needs valid user credentials to log on to the database server, so you must configure a database user account on each of the servers and then add the user account to the NetScaler appliance.
- Then, you configure an MSSQL-ECV or MYSQL-ECV monitor and bind the monitor to each service.
- Finally, you must test the configuration to ensure that it’s working as intended. Before you perform these configuration tasks, make sure you understand how database specific load balancing works.
How database specific load balancing works
For database specific load balancing, you configure a monitor that periodically queries each database server for the names of all the active databases on it. The NetScaler appliance stores the results, and regularly updates the records based on the information retrieved through monitoring. When a client queries a particular database, the appliance uses the configured load balancing method to select a service, and then checks its records to determine whether the database is available on that service. If the records indicate that the database isn’t available, it uses the configured load balancing method to select the next available service, and then repeats the check. The appliance forwards the query to the first available service on which the database is active.
Enable load balancing
You can configure load balancing entities such as services and virtual servers when the load balancing feature is disabled. The entities do not function until you enable the feature.
Enable load balancing by using the CLI
At the command prompt, type the following command to enable load balancing and verify the configuration:
enable ns feature LB
show ns feature
<!--NeedCopy-->
Example:
> enable ns feature LoadBalancing
Done
> show ns feature
Feature Acronym Status
------- ------- ------
1) Web Logging WL OFF
2) Surge Protection SP ON
3) Load Balancing LB ON
.
.
.
24) NetScaler Push push OFF
Done
<!--NeedCopy-->
Enable load balancing by using the GUI
Navigate to System > Settings and, in Configure Basic Features, select Load Balancing.
Configure a load balancing virtual server for database specific load balancing
To configure a virtual server to load balance databases based on availability, you enable the database specific load balancing parameter on the virtual server. Enabling the parameter modifies the load balancing logic so that the NetScaler appliance refers the results of the monitoring probe sent to the selected service, before forwarding the query to that service.
Configure a load balancing virtual server for database specific load balancing using the CLI
At the command prompt, type the following command to configure a load balancing virtual server for database specific load balancing and verify the configuration:
add lb vserver <name> <serviceType> <ipAddress> <port> -dbsLb ENABLED
show lb vserver <name>
<!--NeedCopy-->
Configure services
After you enable the load balancing feature, you must create at least one service for each application server that is to be included in your load balancing setup. The services that you configure provide the connections between the NetScaler appliance and the load balanced servers. Each service has a name and specifies an IP address, a port, and the type of data that is served.
If you create a service without first creating a server object, the IP address of the service is also the name of the server that hosts the service. If you prefer to identify servers by name rather than IP address, you can create server objects and then specify a server’s name instead of its IP address when you create a service.
Configure database users
In databases, a connection is always stateful, which means that when a connection is established, it must be authenticated.
Configure your database user name and password on the NetScaler. For example, if you have a user John configured on the database, you need to configure the user John on the ADC too. Database user names and passwords added to the ADC are added to the nsconfig
file.
Note
Names are case sensitive.
The ADC uses these user credentials to authenticate the clients, and then authenticate the server connections with the database servers.
Add a database user by using the CLI
At the command prompt, type
add db user <username> - password <password>
<!--NeedCopy-->
Example:
add db user nsdbuser -password dd260427edf
<!--NeedCopy-->
Add a database user by using the GUI
Navigate to System > User Administration > Database Users, and configure a database user.
If you’ve changed the password of the database user on the database server, you must reset the password of the corresponding user configured on the NetScaler appliance.
Reset the password of a database user by using the CLI
At the command prompt, type
set db user <username> -password <password>
<!--NeedCopy-->
Example:
set db user nsdbuser -password dd260538abs
<!--NeedCopy-->
Reset the password of database users by using the GUI
Navigate to System > User Administration > Database Users, select a user, and enter new values for the password.
If a database user no longer exists on the database server, you can remove the user from the NetScaler appliance. However, if the user continues to exist on the database server and you remove the user from the ADC appliance, any request from the client with this user name does not get authenticated. Therefore, the user name does not get routed to the database server.
Remove a database user by using the CLI
At the command prompt, type
rm db user <username>
<!--NeedCopy-->
Example:
rm db user nsdbuser
<!--NeedCopy-->
Remove a database user by using the GUI
Navigate to System > User Administration > Database Users, select a user, and click Delete.
Configure a monitor to retrieve the names of active databases
You can create a monitor to retrieve the list of all active databases on a database instance. The monitor logs on to the database server by using a valid user credentials and runs an appropriate SQL query. The SQL query you need to use depends on your SQL server deployment. For example, in an MSSQL database mirroring setup, you can use the following query to retrieve a list of active databases available on a server instance.
select name from sys.databases where state=0
<!--NeedCopy-->
In a MySQL database setup you can use the following queries to retrieve a list of active databases available on a server instance.
Show databases:
You also configure the monitor to evaluate the response for an error condition, and to store the results if there’s no error. If the response contains an error, the monitor marks the service as DOWN. The appliance excludes the service from load balancing decisions until an error is no longer returned.
Note
The database specific load balancing feature is supported only for the MSSQL and MySQL service types. Therefore, the monitor type must be MSSQL-ECV or MYSQL-ECV.
Configure a monitor to retrieve the names of all the active databases hosted on a service by using the CLI
At the command prompt, type the following commands to retrieve the names of all the active databases hosted on a service and verify the configuration:
add lb monitor <monitorName> <type> -userName <string> -sqlQuery <text> -evalRule <expression> -storedb ENABLED
show lb monitor <monitorName>
<!--NeedCopy-->
Configure a monitor to retrieve the names of all the active databases hosted on a service by using the GUI
- Navigate to Traffic Management > Load Balancing > Monitors and configure a monitor of type MSSQL-ECV or MYSQL-ECV.
- In Special Parameters, specify a user name, query, and a rule. For example, for MSSQL-ECV, the query must be “select name from sys.databases where state=0”), and a rule must be MSSQL.RES.TYPE.NE(ERROR). For MYSQL-ECV, the query must be “show databases” and a rule must be MYSQL.RES.TYPE.NE(ERROR).
Availability groups deployment support for MSSQL
Consider the following scenario in which database specific load balancing is configured in a high availability group deployment. S1 through S5 are the services on the ADC appliance. DB1 through DB4 are the databases on the servers represented by the services S1 through S5. AV1 and AV2 are the availability groups. Each availability group contains up to one primary database server instance and up to four secondary database server instances. A service, representing the servers in the availability group, can be primary for one availability group and secondary for another availability group. Each availability group contains different databases and one listener, which is a service. All requests arrive on the listener service that resides on the primary database. AVI contains databases DB1 and DB2. AV2 contains databases DB3 and DB4. L1 and L2 are the listeners on AV1 and AV2 respectively. S1 is the primary service for AV1 and S2 is the primary service for AV2.
Service | List of Active Databases on the Service |
---|---|
S1 | DB1, DB2, DB3, DB4 |
S2 | DB3, DB4 |
S3 | DB3, DB4 |
S4 | DB1, DB2 |
S5 | DB1, DB2 |
Availability Group | Databases | Services representing the Servers in the Availability Group |
---|---|---|
AV1 | DB1, DB2 | S1, S4, S5 |
AV2 | DB3, DB4 | S1, S2, S3 |
The queries flow as follows:
- A READ query for AV1 is load balanced between S4 and S5. S1 is the primary for AV1.
- A WRITE query for AV1 is directed to L1.
- A READ query for AV2 is load balanced between S1 and S3. S2 is the primary for AV2.
- A WRITE query for AV1 is directed to L2.
Sample configuration
- Configure load balancing and content switching virtual servers.
add lb vserver lbwrite -dbslb enabled
add lbvserver lbread MSSQL -dbslb enabled
add csvserver csv MSSQL 1.1.1.10 1433
- Configure two listener services, one for each availability group, and five services S1 through S5 representing databases DB1 through DB4.
add service L1 1.1.1.11 MSSQL 1433
add service L2 1.1.1.12 MSSQL 1433
add service s1 1.1.1.13 MSSQL 1433
add service s2 1.1.1.14 MSSQL 1433
add service s3 1.1.1.15 MSSQL 1433
add service s4 1.1.1.16 MSSQL 1433
add service s5 1.1.1.17 MSSQL 1433
- Bind the services to the load balancing virtual servers.
bind lbvserver lbwrite L1
bind lbvserver lbwrite L2
bind lbvserver lbread s1
bind lbvserver lbread s2
bind lbvserver lbread s3
bind lbvserver lbread s4
bind lbvserver lbread s5
- Configure database users.
add db user nsdbuser1 -password dd260427edf
add db user nsdbuser2 -password ccd1234xyzw
- Configure two monitors, monitor_L1 and monitor_L2 for each listener service, to retrieve the list of active databases in that availability group. Add a monitor, monitor1 to retrieve the list of databases for the secondary database server instance.
add lb monitor monitor_L1 MSSQL-ECV -userName user1 -sqlQuery "SELECT name FROM sys.databases a INNER JOIN sys.dm_hadr_availability_replica_states b ON a.replica_id=b.replica_id INNER JOIN sys.availability_group_listeners c on b.group_id = c.group_id INNER JOIN sys.availability_group_listener_ip_addresses d on c.listener_id = d.listener_id WHERE b.role = 1 and d.ip_address like '1.1.1.11'" -evalRule "MSSQL.RES.TYPE.NE(ERROR)” –storedb ENABLED
add lb monitor monitor_L2 MSSQL-ECV -userNameuser1 -sqlQuery "SELECT name FROM sys.databases a INNER JOIN sys.dm_hadr_availability_replicca_states b ON a.replica_id=b.replica_id INNER JOIN sys.availability_group_listeners c on b.group_id = c.group_id INNER JOIN sys.availability_group_listener_ip_addresses d on c.listener_id = d.listener_id WHERE b.role = 1 and d.ip_address like '1.1.1.12'" -evalRule "MSSQL.RES.TYPE.NE(ERROR)" -storedb ENABLED
add lb monitor monitor1 MSSQL-ECV -userNameuser1 -sqlQuery "SELECT name FROM sys.databases a INNER JOIN sys.dm_hadr_availability_replica_states b ON a.replica_id=b.replica_id WHERE b.role = 2" -evalRule "MSSQL.RES.TYPE.NE(ERROR)" -storedb ENABLED
- Configure read and write policies.
add cs policy pol_write -rule "MSSQL.REQ.QUERY.TEXT.CONTAINS("insert")"
add cs policy pol_read -rule "MSSQL.REQ.QUERY.TEXT.CONTAINS("select")"
- Bind the policies to the content switching virtual server.
bind csvserver csv -targetLBVserver lbwrite -policyName pol_write -priority 11
bind csvserver csv -targetLBVserver lbread -policyName pol_read -priority 12
- Bind monitors to the services. Bind monitors to services L1 and L2 to get the list of active databases for the availability group for which it is the listener. Bind monitors to all the services that are bound to the read-only virtual server.
bind service L1 -monitorName monitor_L1
bind service L2 -monitorName monitor_L2
bind service s1 -monitorName monitor1
bind service s2 -monitorName monitor1
bind service s3 -monitorName monitor1
bind service s4 -monitorName monitor1
bind service s5 -monitorName monitor1
Configuration examples for MSSQL virtual server
To configure a load balancing virtual server for database specific load balancing:
add lb vserver DBSpecificLB1 MSSQL 192.0.2.10 1433 -dbsLb ENABLED
Done
show lb vserver DBSpecificLB1
DBSpecificLB1 (192.0.2.10:1433) - MSSQL Type: ADDRESS
. . .
DBS_LB: ENABLED
Done
<!--NeedCopy-->
To configure services:
add service msservice1 5.5.5.5 MSSQL 1433
To configure a monitor to retrieve the names of all the active databases hosted on a service by using the command line:
add lb monitor mssql-monitor1 MSSQL-ECV -userName user1 -sqlQuery "select name from sys.databases where state=0" -evalRule "MSSQL.RES.TYPE.NE(ERROR)" -storedb EN
Done
show lb monitor mssql-monitor1
1) Name.......: mssql-monitor1 Type......: MSSQL-ECV
...
Special parameters: Database.....:""
User name.....:"user1"
Query..:select name from sys.databases where state=0 EvalRule...:MSSQL.RES.TYPE.NE(ERROR)
Version...:70 STORE_DB...:ENABLED
Done
<!--NeedCopy-->
Configuration examples for MySQL virtual server
To configure a load balancing virtual server for database specific load balancing:
add lb vserver DBSpecificLB1 MYSQL 192.0.2.10 3306 -dbsLb ENABLED
Done
show lb vserver DBSpecificLB1
DBSpecificLB1 (192.0.2.10:3306) - MYSQL Type: ADDRESS
. . .
DBS_LB: ENABLED
Done
<!--NeedCopy-->
To configure services:
add service msservice1 5.5.5.5 MYSQL 3306
<!--NeedCopy-->
To configure a monitor to retrieve the names of all the active databases hosted on a service by using the command line:
add lb monitor mysql-monitor1 MYSQL-ECV -userName user1 -sqlQuery "show databases" -evalRule "MYSQL.RES.TYPE.NE(ERROR)" -storedb ENABLED
Done
show lb monitor mysql-monitor1
1) Name.......: mysql-monitor1 Type......: MYSQL-ECV State....: ENABLED
...
Special parameters: Database.....:""
User name.....:"user1" Query..:show databases
EvalRule...:MYSQL.RES.TYPE.NE(ERROR) STORE_DB...:ENABLED
Done
<!--NeedCopy-->
Share
Share
In this article
- How database specific load balancing works
- Enable load balancing
- Configure a load balancing virtual server for database specific load balancing
- Configure a load balancing virtual server for database specific load balancing using the CLI
- Configure services
- Configure database users
- Configure a monitor to retrieve the names of active databases
- Availability groups deployment support for MSSQL
- Configuration examples for MSSQL virtual server
- Configuration examples for MySQL virtual server
This Preview product documentation is Cloud Software Group Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Cloud Software Group Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Cloud Software Group product purchase decisions.
If you do not agree, select I DO NOT AGREE to exit.