Pages

Wednesday, July 23, 2008

Load balancing with AS 10.1.3 and with Web Cache

This week I had to setup load balancing on three 10.1.3 OC4J containers so the load is spread is over the servers and when an oc4j container spontaneous reboots the others servers can handle the load until the container is back. We had a little problem where the production server (windows 32bits) gave a out of memory exception, an out of swap error and the application users had to wait for 5 minutes before they can work again.
I first used Oracle Web Cache which is a 10.1.2 Application Server product. This was pretty easy but very stupid in 10.1.3. ( the second part of this blog I will show you how easy this is in 10.1.3
The first step in Web Cache is to configure the listening ports for the load balancer.


In my case Web cache will listen on port 80 and 7778.

Now we can add the application servers ( original servers)

Define a website url for which you want to load balance, I will use the Enterprise Manager Website /em

The site is /em/
Add a site to server mapping where we connect the site em to the availible AS server
Now we have to make sure that a new web session is always run on the same original server else we cannot log in.

Use for the em website as session JSESSIONID and OC4J-based as binding mechanism. We are now ready with Web Cache. The only thing still to do is to add a virtual hsot to the httpd.conf of the Application Servers. We have to do this else the em website is redirected to one of the application server instead of the load balancer adress.


NameVirtualHost XPCND7010XMP.work.local:7777
<VirtualHost XPCND7010XMP.work.local:7777>
ServerName XPCND7010XMP.work.local
Port 80
</VirtualHost>
XPCND7010XMP.work.local:7777 is the application server on port 7777.
inside VirtualHost we use the adress of the load balancer.
That's all in webcache.

You don't have to do this in 10.1.3. Just install on the load balancer a http server ( custom install in the application server installer ).
Add in every AS Home the following topology lines to the opmn.xml and you have a cluster.

<notification-server interface="ipv4">
<port local="6100" remote="6200" request="5003"/>
<ssl enabled="true" wallet-file="$ORACLE_HOME/opmn/conf/ssl.wlt/default"/>
<topology>
<discover list="*233.0.0.2:1500"/>
</topology>
</notification-server>
On the application servers you don't need the http servers anymore so you can disable.
In this cluster you can have only one Enterprise Manager application so you have to disable it on all the application servers except one. ( server.xml and default-web-site.xml )
That's all in 10.1.3

No comments:

Post a Comment