Set up basic load balancing
Enable load balancing
To enable load balancing by using the CLI
-
enable ns feature LB
-
show ns feature
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
To enable load balancing by using the GUI
Configure a server object
To create a server object by using the CLI
add server `<name>`@ `<IPAddress>`@ | `<domain>`
add server web_serv 10.102.27.150
add server web_serv test.com
To create a server object by using the GUI
Configure services
Create a service
-
HTTPUsed for load-balanced servers that accept HTTP traffic, such as standard websites and web applications. The HTTP service type enables the NetScaler appliance to provide compression, content filtering, caching, and client keep-alive support for your Layer 7 web servers. This service type also supports virtual server IP port insertion, redirect port rewriting, Web 2.0 Push, and URL redirection support.Because HTTP is a TCP-based application protocol, you can also use the TCP service type for web servers. If you do so, however, the NetScaler appliance is able to perform only Layer 4 load balancing. It cannot provide any of the Layer 7 supports described earlier.
-
SSLUsed for servers that accept HTTPS traffic, such as ecommerce websites and shopping cart applications. The SSL service type enables the NetScaler appliance to encrypt and decrypt SSL traffic (perform SSL offloading) for your secure web applications. It also supports HTTP persistence, content switching, rewrite, virtual server IP port insertion, Web 2.0 Push, and URL redirection.You can also use the SSL_BRIDGE, SSL_TCP, or TCP service types. If you do so, however, the appliance performs only Layer 4 load balancing. It cannot provide SSL offloading or any of the Layer 7 supports described.
-
FTPUsed for servers that accept FTP traffic. The FTP service type enables the NetScaler appliance to support specific details of the FTP protocol.You can also use TCP or ANY service types for FTP servers.
-
TCPUsed for servers that accept many different types of TCP traffic, or that accept a type of TCP traffic for which a more specific type of service is not available.You can also use the ANY service type for these servers.
-
SSL_TCPUsed for servers that accept non-HTTP-based SSL traffic, to support SSL offloading.You can also use the TCP service type for these services. If you do so, the NetScaler appliance performs both the Layer 4 load balancing and SSL offloading.
-
UDPUsed for servers that accept UDP traffic. You can also use the ANY service type.
-
SSL_BRIDGEUsed for servers that accept SSL traffic when you do not want the NetScaler appliance to perform SSL offloading. Alternatively, you can use the SSL_TCP service type.
-
NNTPUsed for servers that accept Network News Transfer Protocol (NNTP) traffic, typically Usenet sites.
-
DNSUsed for servers that accept DNS traffic, typically nameservers. With the DNS service type, the NetScaler appliance validates the packet format of each DNS request and response. It can also cache DNS responses. You can apply DNS policies to DNS services.You can also use the UDP service type for these services. If you do, however, the NetScaler appliance can only perform Layer 4 load balancing. It cannot provide support for DNS-specific features.
-
ANYUsed for servers that accept any type of TCP, UDP, or ICMP traffic. The ANY parameter is used primarily with firewall load balancing and link load balancing.
-
SIP-UDPUsed for servers that accept UDP-based Session Initiation Protocol (SIP) traffic. SIP initiates, manages, and terminates multimedia communications sessions, and has emerged as the standard for Internet telephony (VoIP).You can also use the UDP service type for these services. If you do, however, the NetScaler appliance performs only Layer 4 load balancing. It cannot provide support for SIP-specific features.
-
DNS-TCPUsed for servers that accept DNS traffic, where the NetScaler appliance acts as a proxy for TCP traffic sent to DNS servers. With services of the DNS-TCP service type, the NetScaler appliance validates the packet format of each DNS request and response and can cache DNS responses, as with the DNS service type.You can also use the TCP service type for these services. If you do, however, the NetScaler appliance only performs Layer 4 load balancing of external DNS name servers. It cannot provide support for any DNS-specific features.
-
RTSPUsed for servers that accept Real Time Streaming Protocol (RTSP) traffic. RTSP provides delivery of multimedia and other streaming data. Select this type to support audio, video, and other types of streamed media.You can also use the TCP service type for these services. If you do, however, the NetScaler appliance performs only Layer 4 load balancing. It cannot parse the RTSP stream or provide support for RTSPID persistence or RTSP NAT.
-
DHCPRAUsed for servers that accept DHCP traffic. The DHCPRA service type can be used to relay DHCP requests and responses between VLANs.
-
DIAMETERUsed for load balancing Diameter traffic among multiple Diameter servers. Diameter uses message-based load balancing.
-
SSL_DIAMETERUsed for load balancing Diameter traffic over SSL.Services are designated as DISABLED until the NetScaler appliance connects to the associated load-balanced server and verifies that it is operational. At that point, the service is designated as ENABLED. Thereafter, the NetScaler appliance periodically monitors the status of the servers, and places any that fail to respond to monitoring probes (called health checks) back in the DISABLED state until they respond.Note:You can create a range of services from a single CLI command or the same dialog box. The names in the range vary by a number used as a suffix/prefix. For example, service1, service2, and so on. From the GUI, you can specify a range only in the last octet of the IP address, which is the fourth in case of an IPv4 address and the eighth in an IPv6 address. From the command line, you can specify the range in any octet of the IP address.
-
QUICUsed by load balancing servers that accept UDP based QUIC video traffic. The service enables the NetScaler appliance to optimize encrypted ABR video traffic over the UDP protocol.
To create a service by using the CLI
add service <name> <serverName> <serviceType> <port>
add service Service-HTTP-1 192.0.2.5 HTTP 80
To create a service by using the GUI
-
Navigate to Traffic Management> Load Balancing > Services.
-
In the details pane, click Add.
-
In the Create Service dialog box, specify values for the following parameters:
-
Service Name—name
-
Server—serverName
-
Protocol—serviceType
-
Port—port
-
-
Click Create, and then click Close. The service you created appears in the Services pane.
Create a virtual server
-
Virtual server names prefixed with “app_” do not appear in the GUI though they are present in the ns.conf file and are displayed when you run the show command. However, virtual server names prefixed with “app” are displayed in the GUI.
-
The virtual server is designated as DOWN until you bind the services that you created to it, and until the NetScaler connects to those services and verifies that they are operational. After the verification, the virtual server is designated as UP.
-
If you want the virtual server to listen to all the ports, use a wildcard (*) character instead of the specific port.Example:
add lb vserver v1 TCP 1.11.1.1 *.
To create a virtual server by using the CLI
add lb vserver <name> <serviceType> <ip> <port>
add lb vserver Vserver-LB-1 HTTP 10.102.29.60 80
To create a virtual server by using the GUI
Bind services to the virtual server
| Virtual Server Type | Service Type | Comment |
|---|---|---|
| HTTP | SSL | You would normally bind an SSL service to an HTTP virtual server to do encryption. |
| SSL | HTTP | You would normally bind an HTTP service to an SSL virtual server to do SSL offloading. |
| SSL_TCP | TCP | You would normally bind a TCP service to an SSL_TCP virtual server to do SSL offloading for other TCP (SSL decryption without content awareness). |
To bind a service to a load balancing virtual server by using the CLI
bind lb vserver <name> <serviceName>
bind lb vserver Vserver-LB-1 Service-HTTP-1
To bind a service to a load balancing virtual server by using the GUI
-
Navigate to Traffic Management> Load Balancing > Virtual Servers, and select a virtual server.
-
Click in the Service section, and select a service to bind.
Verify the configuration
View the properties of a server object
To view the properties of server objects by using the CLI
show server <serverName>
show server server-1
To view the properties of server objects by using the GUI
View the properties of a virtual server
To view the properties of a load balancing virtual server by using the CLI
show lb vserver <name>
show lb vserver Vserver-LB-1
To view the properties of a load balancing virtual server by using the GUI
-
Navigate to Traffic Management > Load Balancing > Virtual Servers.
-
In the details pane, click a virtual server to display its properties at the bottom of the details pane.
-
To view the cache redirection and content switching virtual servers that are bound to this virtual server, click Show CS/CR Bindings.
View the properties of a Service
To view the properties of services by using the CLI
show service <name>
show service Service-HTTP-1
To view the properties of services by using the GUI
View the bindings of a service
To view the bindings of a service by using the CLI
show service bindings <name>
show service bindings Service-HTTP-1
To view the bindings of a service by using the GUI
-
Navigate to Traffic Management > Load Balancing > Services.
-
In the details pane, select the service whose binding information you want to view.
-
In the Action tab, click Show Bindings.
View the statistics of a virtual server
-
Name
-
IP address
-
Port
-
Protocol
-
State of the virtual server
-
Rate of requests received
-
Rate of hits
To display virtual server statistics by using the CLI
stat lb vserver [`<name>`]
stat lb vserver server-1
To display virtual server statistics by using the GUI
-
Navigate to Traffic Management > Load Balancing > Virtual Servers.
-
If you want to display the statistics for only one virtual server, in the details pane, select the virtual server whose statistics you want to display.
-
In the details pane, click Statistics.
View the statistics of a service
To view the statistics of a service by using the CLI
stat service <name>
stat service Service-HTTP-1
To view the statistics of a service by using the GUI
-
Navigate to Traffic Management > Load Balancing > Services.
-
In the details pane, select the service whose statistics you want to view (for example, Service-HTTP-1).
-
Click Statistics. The statistics appear in a new window.