Secure Global Desktop 4.40 Administration Guide > SGD Servers, Arrays, and Load Balancing > Load Balancing User Sessions
User session load balancing is concerned with choosing a SGD server to log in to. You can use a number of mechanisms to choose an SGD server, such as an external hardware load balancer or round-robin DNS.
When load balancing user sessions, the most important factor is session persistence. A user session begins when a user logs in to an SGD server and the session is owned by that server. As the user interacts with SGD, further HTTP requests are sent over the webtop connection to the SGD Web Server. If network connections are load-balanced, webtop HTTP requests might be directed to any SGD server in the array. If a webtop HTTP request goes to an SGD server that does not own the user session, this can cause the user session to transfer to that SGD server (sometimes called session grabbing) and the windows of any running applications might disappear, or the request can cause the visible state of the user's session to be incorrect. This means to load balance user sessions successfully, webtop HTTP requests must persist so that they always go to the correct SGD server.
In a default SGD installation, additional configuration using a load-balancing JavaServer Page (JSP) is required to make webtop HTTP connections persistent. The JSP contains a JavaScript script that sets a cookie, and that cookie is used to redirect webtop HTTP requests to the correct server.
The load-balancing JSP can only be used if the following conditions are met:
The load-balancing JSP can be used in two ways:
To use the load-balancing JSP to distribute user sessions, one member of the array acts as the load distribution server. The following configuration uses the primary server in the array.
/sgd
web application directory.
# cd /opt/tarantella/webserver/tomcat/*/webapps/sgd/ # cp -rp admin/loaddist/ swcd/
Note When you copy the files, ensure you use the -p
option to preserve the file permissions.
swcd.jsp
).
Amend the hosts = new Array
section, for example:
hosts[0] = "http://www1.example.com" hosts[1] = "http://www2.example.com" ... hosts[4] = "http://www5.example.com"
If you are using secure connections, ensure the URLs begin https://
.
Note Only include the primary server in the list if you want the primary server to host user sessions.
LBHOST
variable.
Remove the first comment marks (//
) as follows:
var LBHOST = null // Not in Load Balancer/Round Robin DNS mode
http://primary.example.com/sgd
.
The login URL must be the primary server.
Note The http://primary.example.com
URL can also be used, but this URL cannot be used in a Client Profile.
To configure HTTPS connections:
If needed, users can log in to the primary server by using the URL of the webtop as the login URL, for example use
http://primary.example.com/sgd/standard.jsp
for the standard webtop.
When using an external mechanism, such as a hardware load balancer or round-robin DNS, for load balancing user sessions, the following factors are important:
The following configuration is an example of using the load-balancing JSP with an external hardware load balancer. The load balancer is also an SSL accelerator. The load balancer has also been configured to allow access to the SGD servers using their external DNS names. With this configuration:
You configure the load-balancing JSP as follows:
/sgd
web application directory.
# cd /opt/tarantella/webserver/tomcat/*/webapps/sgd/ # cp -rp admin/loaddist/ swcd/
Note When you copy the files, ensure you use the -p
option to preserve the file permissions.
swcd.jsp
).
Amend the hosts = new Array
section, for example:
hosts[0] = "http://www1.example.com" hosts[1] = "http://www2.example.com" ... hosts[4] = "http://www5.example.com"
LBHOST
variable.
Remove the first comment marks (//
) and enter the external DNS name of the host, for example:
var LBHOST = "http://www1.example.com"" // LB mode
https://loadbalancer.indigo-insurance.com/sgd
.
The login URL must contain the load balancer DNS name.
Note The https://loadbalancer.example.com
URL can also be used, but this URL cannot be used in the client profile.
To use HTTPS connections to the SGD servers, ensure that the URLs
in the load-balancing JSP begin https://
. Then perform either of the following configuration:
Using SGD in firewall forwarding mode can also help to simplify the configuration needed when using an external load balancer. With firewall forwarding, the HTTP and AIP connections to SGD are made over a single port, usually TCP port 443. The SGD server listens on this port for any AIP traffic and forwards all other traffic to the SGD Web Server.
If SGD security services are enabled and the external load balancer is configured to decrypt SSL connections and forward them as unencrypted connections, you must configure each SGD server in the array to accept plain text connections on the secure port. You do this as follows:
Alternatively, use the following command:
$ tarantella config edit --array --security-acceptplaintext 1
This configuration allows the SGD SSL daemon to accept plain text on the port configured for secure connections and forward it to SGD as SSL traffic it had decrypted itself.
This section describes the additional configuration available for the load-balancing JSP.
By default, the standard webtop is used. To use another webtop, for example a customized webtop, amend the following line:
var TARGET="/sgd/standard.jsp"
By default, the load-balancing JSP displays a splash screen in English using the images in the /sgd/swcd/
directory.
To display a localized splash screen, change the default location of the splash screen images as follows:
// ** Location of gif files <% // If the gifs are located in the locale dependent resource use the Path below String path = getContextPath(request) + "/resources/images/splash/locale=" + getBestSupportedLocale(request) + "/"; // Default location //String path = "swcd/"; %>
The following tables lists the other variables used by the load-balancing JSP.
Variable | Default | Description |
---|---|---|
SGDLDCOOKIE |
SGD_SWCDCOOKIE |
The name of the cookie used for load balancing purposes. |
TIMEOUT |
10000 | The time in milliseconds the load-balancing JSP waits for a response from the SGD Web Server on the selected host. If the timeout period elapses, the next host in the list is tried. |
TESTGIF |
/sgd/resources/images/webtop/secure.gif |
The file the load-balancing JSP attempts to get from the web server on the selected host. This is used to check whether the host is available. |
Copyright © 1997-2007 Sun Microsystems, Inc. All rights reserved.