users@glassfish.java.net

Re: clustering/failover

From: Glenn Holmer <gholmer_at_weycogroup.com>
Date: Fri, 15 Feb 2013 11:25:21 -0600

On 02/14/2013 11:54 AM, Tom Mueller wrote:
> On 2/14/13 11:12 AM, Glenn Holmer wrote:
>> On 02/13/2013 09:18 AM, Glenn Holmer wrote:
>>> asadmin create-network-listener --jkenabled true --target test_cluster
>>> --protocol http-listener-1 --listenerport "\${AJP_PORT}" jk-listener
>>>
>>> The example in the GlassFish documentation gives just ${AJP_PORT} (as
>>> opposed to "\${AJP_PORT}"), which gave me "Enter the value for the name
>>> operand".
> Yes, the \ is necessary (or use single quotes). The shell is expanding
> ${AJP_PORT} within double quotes as an environment variable.

Yes, thanks, that's what I thought. Sometimes one wonders if examples
are meant to contain "insert value here" text.

I'm testing now with the "clusterjsp" sample program to keep things
simple. If I access that app on the balancer, then down the instance I
was on and try again, it does fail over to the other instance... but I
get a different session. Looking at the output of "ps ax" on the
machines with the instances, I do see -DjvmRoute=nod1test and
-DjvmRoute=nod2test, so it looks as though those properties are set
correctly.

I'm working from the workers documentation here:

http://tomcat.apache.org/connectors-doc/reference/workers.html

One of the things that page says is "If you want to use session
stickiness, you must set different jvmRoute attributes in the Engine
element in Tomcat's server.xml." I'm assuming that corresponds to the
"-DjvmRoute..." property on the GlassFish instances? It goes on to say
"Furthermore the names of the workers which are managed by the balancer
have to be equal to the jvmRoute of the Tomcat instance they connect
with", which is the case in my setup.

I guess what I don't understand is how jvmRoute gets set in the first
place. Is the instance supposed to set that when a session is established?

-- 
Glenn Holmer
Weyco Group, Inc.
phone: 414-908-1809
fax: 414-908-1601