users@glassfish.java.net

Re: Glassfish 3.1 Clustering

From: Amy Roh <amy.roh_at_oracle.com>
Date: Mon, 06 Jun 2011 14:37:27 -0700

On 6/5/11 2:51 PM, forums_at_java.net wrote:
> I have configured Glassfish 3.1 with a clustering in 2 machines, it
> seems to
> works, but I have some questions/problems:
>
> - I have configured apache+ Mod_jk to load balance but seems that
> session are
> not replicated and are note working correctly with this configuration,
> application is deployed in cluster with availability. In Glassfish
> cluster I
> have created 2 listener in port 8011 and 8012, used 8011 for node1 and
> 8012
> for node2 is this correct or with only 1 is enough?

You should create a jk-enabled listener with system properties
${AJP_PORT} and ${AJP_INSTANCE_NAME} for each instance.

For example,

asadmin create-network-listener --jkenabled true --target cluster1
--protocol http-listener-1 --listenerport ${AJP_PORT} jk-listener

asadmin create-jvm-options --target cluster1
"-DjvmRoute=\${AJP_INSTANCE_NAME}"

Configure the above system properties for each instance in the cluster.
For example, for a cluster instance named "instance1", run these commands:

asadmin create-system-properties --target instance1 AJP_INSTANCE_NAME=instance1
asadmin create-system-properties --target instance1 AJP_PORT=8009

asadmin create-system-properties --target instance2 AJP_INSTANCE_NAME=instance2
asadmin create-system-properties --target instance2 AJP_PORT=8010

You can find full instructions in the following blogs -

http://wikis.sun.com/display/GlassFish/LoadBalanceMod_jkDemo

http://blogs.oracle.com/jluehe/entry/supporting_apache_loadbalancer_with_glassfish

http://wikis.sun.com/display/glassfish/FaqApacheLoadbalancerPitfalls

hth,
Amy

>
> - Also I have tried to balance using balance
> (http://www.inlab.de/balance.html) and with this method seems that
> sessions
> replication are working correctly, but I'm not sure what is the best
> method
> and adv/inco because glassfish docs detail only apache and mod_jk are
> supported... Why?
>
> Thanks
>
>
>
>
> --
>
> [Message sent by forum member 'kithouna']
>
> View Post: http://forums.java.net/node/809649
>
>