InomHitta mer dokumentationSupportresurser som ingår | Ladda ner denna bok i PDF (1536 KB)
Setting up RMI-IIOP Load Balancing and FailoverYou can set up RMI-IIOP load balancing and failover for applications running in the application client container (ACC). Weighted round-robin load balancing is also supported.
|
jvmarg value = "-Dcom.sun.appserv.iiop.endpoints=host1:port1,host2:port2,..." |
If you require weighted round-robin load balancing, perform the following steps:
Set the load-balancing weight of each server instance.
asadmin set instance-name.lb-weight=weight |
In the sun-acc.xml, set the com.sun.appserv.iiop.loadbalancingpolicy property of the ACC to ic-based-weighted.
… <client-container send-password="true"> <property name="com.sun.appserv.iiop.loadbalancingpolicy" value="ic-based-weighed"/> …
Deploy your client application with the --retrieve option to get the client jar file.
Keep the client jar file on the client machine.
For example:
asadmin deploy --user admin --passwordfile pw.txt --retrieve /my_dir myapp |
Run the application client as follows:
appclient -client clientjar -name appname
In this example, the load-balancing weights in a cluster of three instances are to be set as shown in the following table.
|
Instance Name |
Load-Balancing Weight |
|---|---|
|
i1 |
100 |
|
i2 |
200 |
|
i3 |
300 |
The sequence of commands to set these load balancing weights is as follows:
asadmin set i1.lb-weight=100 asadmin set i2.lb-weight=200 asadmin set i3.lb-weight=300 |
To test failover, stop one instance in the cluster and see that the application functions normally. You can also have breakpoints (or sleeps) in your client application.
To test load balancing, use multiple clients and see how the load gets distributed among all endpoints.