users@glassfish.java.net

Re: Glassfish Clustering across 2 Nodes and In Memory Replication

From: <glassfish_at_javadesktop.org>
Date: Wed, 24 Jun 2009 15:24:03 PDT

Hi radiusmax:

There are 2 different questions here. The first is involves a bug that is fixed that applies to
two-node clusters in general. Please see:

http://blogs.sun.com/memrep/entry/2_node_cluster_memory_replication

But there's a second question you asked - which is about whether you need a load balancer if you are doing simple tests in a multi-machine cluster. The answer is "yes you do".

What we can do on a single machine is a little "work-around" we call "port-hopping" which takes advantage of browser and cookie behavior.

So e.g. if you deployed clusterjsp with the default context-root you would invoke it
as:

http://<host>:<port of instance1>/clusterjsp

and when you want to simulate "failover" you would enter typically

http://<host>:<port of instance2>/clusterjsp

This works fine but only when the instances are on a single machine. Once you set up
a multi-machine cluster because your host part of the url will change, the browser will not
send the jsessionid and jsessionversion cookies. So in summary again you do need
a web-server and loadbalancer to front a multi-machine cluster.

hope this helps
[Message sent by forum member 'lwhite' (lwhite)]

http://forums.java.net/jive/thread.jspa?messageID=352815