News, tips, partners, and perspectives for the Oracle Solaris operating system

How to use the Load Balancing feature in Sun Cluster

Guest Author
Do you know that Sun Cluster provides a Load Balancing feature in addition to High Availability? This is a cool feature where you can configure the applications/data services to run on multiple systems simultaneously with existing cluster hardware. Yes, there is no need to add extra hardware for achieving this IP-based load balancing.

Most of the applications that can be highly-available can also be configured as scalable with a few extra requirements described in this document. If your application meets the above requirements, then you are ready to configure the scalable application with few simple steps

Here are the instructions:

Apache is used as an example application to demonstrate how easily the Load Balancing feature can be enabled with Sun Cluster.  Below examples show the new CLI available in sc3.2, however the same can be achieved with equivalent old CLI available in previous releases.

Register the Resource Type:

To configure a scalable resource, the RTR file should declare the Scalable property and also set FAILOVER property to false . If you are using existing data service packages to configure the scalable resource, make sure the above settings are true. Otherwise, reset the values and update the packages.

# clrt register SUNW.apache

Configure the Shared Address resource:

# clresourcegroup create shared-rg
# clressharedaddress create -g shared-rg octet-1
# clresourcegroup online -M apache-rg

This example assumes that IP address is already configured for host name octet-1.

Create the scalable resource group:

# clresourcegroup create -S apache-rg

Create the scalable resource:

Here are the descriptions of few properties of interest: 

  • Scalable: TRUE specifies the resource to be scalable, which enables the network framework responsible for load balancing.
  • Port_list: List of port numbers where the server is listening.
  • Load_balancing_policy: This value is used in deciding how the load will be distributed across the nodes. The options are: 
    • LB_WEIGHTED: Load will be distributed based on weights specified using the Load_balancing_weights property.
    • LB_STICKY: Load will be distributed based on the client's IP address. In this case, the set of ports is known during the configuration and all the requests coming from the same client IP address will be distributed to the same node listening on this predefined port.
    • LB_STICKY_WILD: Load will be distributed based on the client's IP address and in this case the ports are not known in advance and are assigned dynamically. Here, all the requests coming from the same client will go to the same node regardless of the port number to which that IP address is coming.

# clresource create -g apache-rg -t SUNW.apache \\
-p resource_dependencies=octet-1 -p Port_list=80/tcp \\
-p scalable=true  -p bin_dir=/usr/apache/bin \\
-p Load_balancing_policy=LB_STICKY apache-rs

For detailed descriptions of the above properties or other scalable properties, see this document.

Bring the resource group online

# clresourcegroup online -M apache-rg

Check the status of the resources:

# clresource status

=== Cluster Resources ===

Resource Name       Node Name      State        Status Message
---------------------      ------------------    --------      ---------------------
shared-ip                     poctet1            Online       Online - SharedAddress online.
                                    poctet2            Offline      Offline
                                    poctet3            Offline      Offline
                                    poctet4            Offline      Offline

apache-rs                     poctet1            Online       Online - Service is online.
                                    poctet2            Online       Online - Service is online.
                                    poctet3            Online       Online - Service is online.
                                    poctet4            Online       Online - Service is online.

That's it, you are ready to use Sun Cluster with Load balancing.
Now, you can observe the client requests  getting distributed across the nodes according to the load_balancing_policy.

Prasanna Kunisetty
Sun Cluster Engineering 

Join the discussion

Comments ( 9 )
  • Jeroen Tuesday, February 6, 2007
    So what happens if the GIF node dies ?
    Isn't the GIF itself a SPOF ?
  • Prasanna Kunisetty Tuesday, February 6, 2007
    As you can see from the configuration steps, we are first configuring an HA IP address called Shared Address in the failover resource group before configuring the scalable resource apache. The node where this shared IP address is plumbed on the primary interface becomes the GIF node. In case of this GIF node failure, the Shared IP address will failover to the other node of the cluster and that will become the new GIF node. So, in summary, the shared IP address is configured as failover resource which will failover to new node and will not be a SPOF. Hope that answers your question and thanks for your interest in Sun Cluster.
  • Sunny Tuesday, February 20, 2007
    The link to docs.sun.com document does not work. Please update.
  • Prasanna Kunisetty Wednesday, February 21, 2007
    Hi, I just verified both the links and they seem to work fine. It' supposed to open up the doc links in another window, so just make sure that you did not block the pop-up windows. Meanwhile, you can use the following links to access the information:
    For the information related to suitability of the applications for scalability, see the doc at:
    For information related to resource properties, see the doc at:
    Prasanna Kunisetty
  • Mick Monday, March 19, 2007
    My understanding with SC3.1 is that only iSCSI LUNS from at NetAPP filer are supported as Quorum devices. Are or when will Sun NAS appliances (5xxx) be supported as quorum devices ?
  • Prasanna Kunisetty Monday, March 26, 2007
    Currently Sun NAS as a quorum device is supported for Oracle RAC and details are available at http://www.sun.com/storagetek/oracle/NAS5320_SunCluster_RAC.pdf.
    General support for Sun NAS on Sun Cluster is being worked on and will be
    available in the next Sun Cluster release.
  • Patrick de Ruiter Thursday, November 22, 2007

    Hi, I would like to know if you can use the same storage configuration with LB and HA clustering.

    Thanks, Patrick

  • usman Thursday, March 19, 2009

    thanks really very nice article.

  • Srinivas Erukulla Friday, April 17, 2009


    I have created a scalable data service for an application server written in Java. I have used agent builder to create the RTR file and registered the resource type. During the creation I selected scalable TRUE. Also verified the RTR file. But the load balancing feature does not work (i.e. all the soap/http requests not distributed between two nodes in the cluster). Here is the setting:

    policy ' LB_WEIGHTED' load_balancing_weights 'null'

    Where am I going wrong? I am setting port_list property with application server port, but sending requests to a different port . Is load balancing strictly port dependent?



Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.