Sun GlassFish Communications Server 2.0 High Availability Administration Guide

Procedure to Set Up Converged Load Balancing

Use the Admin Console or the asadmin command to configure load balancing in your environment. The following sections provide you more information.

ProcedureTo Set Up Converged Load Balancing Using the Admin Console

  1. Create a load balancer.

    On the left frame, click Converged Load Balancers and then click New. In the New Converged Load Balancer page, provide the load balancer name and also select target clusters or instances that will act as load balancers.

    Optionally, you can specify the following settings:

    • Configuration File Name — Specifies the name of the converged load balancer's configuration file. The default path and name of the configuration file is domain-dir/config/cluster-config/converged-loadbalancer.xml.

    • Automatically Apply Changes — Specifies whether to automatically apply configuration changes to the target server instances. This setting is off by default. Set this to true and generate the converged load balancer's configuration file.

    • Self Load Balancing — Specifies whether the target cluster is self-load-balancing. This setting is on by default. For production environments, only self-load-balancing target clusters are supported.

  2. For a load balancer that is not self-load-balancing, add references to clusters or stand-alone server instances for the load balancer to manage.

    On the left frame, click the Converged Load Balancers node and then click the desired load balancer listed under the node. Open the Converged Load Balancer LB Targets tab, click Manage LB Targets and in the Manage LB Targets page, select the required LB targets.

    You may select clusters or stand-alone instances as LB targets. Note that you cannot have a combination of both clusters and stand-alone instances as selected LB targets.


    Note –

    This step is not supported in a production environment.


  3. If the cluster was already started when you created the load balancer, you must restart the cluster to start the load balancer.

See Also

For more information, see the Admin Console online help.

ProcedureTo Set Up Converged Load Balancing Using asadmin Commands

You can perform the following steps using a single asadmin command, create-converged-lb.

  1. Create a load balancer configuration.

    Use the asadmin create-converged-lb-config command.

  2. Add a reference to a cluster or stand-alone server instance for the load balancer to manage.

    Use the asadmin create-converged-lb-ref command.


    Note –

    While you perform the iterative process of setting up and defining the cluster deployment, it is recommended that --autocommit be set to false. By default, this option is set to false, primarily to prevent generation of intermediate converged load balancer files, which would get generated for every change in domain.xml, which impact the converged load balancer's view of its configuration. After the cluster deployment definition has reached a stable point in evolution, set --autocommit to true.



Example 2–1 Creating a Converged Load Balancer

The following series of asadmin commands sets up a cluster, a node agent, and a self-load-balanced converged load balancer.


asadmin> create-cluster cluster1
    Command create-cluster executed successfully.
asadmin>create-node-agent --user admin --passwordfile pass.txt 
--host host1 nodeagent1
    Command create-node-agent executed successfully.
asadmin>create-node-agent --user admin --passwordfile pass.txt 
--host host1 nodeagent2
    Command create-node-agent executed successfully.
asadmin>create-instance --user admin --passwordfile pass.txt --nodeagent nodeagent1 
--cluster cluster1 cluster1_instance1
   Command create-instance executed successfully.
asadmin> create-instance --user admin --passwordfile pass.txt 
--nodeagent nodeagent2 --cluster cluster1 cluster1_instance2
   Command create-instance executed successfully.
asadmin> create-converged-lb --user admin --passwordfile pass.txt 
--configfile clb.xml --autocommit=true --lbenableallinstances=true 
--target cluster1 clb-1
   Command create-converged-lb executed successfully.
asadmin> start-node-agent nodeagent1
   Command start-node-agent started successfully.
asadmin> start-node-agent nodeagent2
   Command start-node-agent started successfully.
asadmin> start-cluster cluster1
 cluster1_instance1 is running, does not require restart
 cluster1_instance2 is running, does not require restart
 Command start-cluster executed successfully.

If the cluster was already started when you created the load balancer, you must restart the cluster to start the load balancer.


See Also

For more information about these asadmin commands, see the Sun GlassFish Communications Server 2.0 Reference Manual.