Friday Feb 02, 2007
Friday Feb 02, 2007
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:
# 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
Posted by jason arneil on February 06, 2007 at 08:11 AM PST #
Posted by Prasanna Kunisetty on February 06, 2007 at 01:03 PM PST #
Posted by Jeroen on February 06, 2007 at 04:35 PM PST #
Posted by Prasanna Kunisetty on February 06, 2007 at 05:41 PM PST #
Posted by Sunny on February 20, 2007 at 05:45 PM PST #
Posted by Prasanna Kunisetty on February 21, 2007 at 10:54 AM PST #
Posted by Mick on March 19, 2007 at 04:55 PM PDT #
Posted by Prasanna Kunisetty on March 26, 2007 at 11:00 AM PDT #
Hi, I would like to know if you can use the same storage configuration with LB and HA clustering.
Thanks, Patrick
Posted by Patrick de Ruiter on November 22, 2007 at 01:31 AM PST #
http://docs.sun.com/app/docs/doc/819-0581/6n30f91re?a=view
Posted by 65.89.178.70 on May 14, 2008 at 06:44 AM PDT #
thanks really very nice article.
Posted by usman on March 19, 2009 at 05:05 PM PDT #
Hi,
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?
Thanks,
Srini
Posted by Srinivas Erukulla on April 17, 2009 at 02:58 PM PDT #