users@glassfish.java.net

Re: how to setup loadbalancing on glassfish?

From: <glassfish_at_javadesktop.org>
Date: Thu, 24 Apr 2008 07:35:47 PDT

Yes the architecture is LVS->HTTPD->Glassfish.

Glassfish servers don't need to run in cluster mode, LVS can handle so called connection stickiness.
When a connection is made and it is decided which real server should handle it, a template is created for the given source IP (with configurable netmask). After connection is closed and new created, LVS finds the template, and sends packet to the server that handled the original request. Connection stickiness timeout is configurable. You would normally set it to your session timeout.
If the original server fails and a packet arrives, it is not sent to the dead server but to a new one - in this case user will probably think he was logged out.

Heartbeat ensures the balancer IP address moves to another backup balancer when master dies.

LVS can also use so called firewall-marks (by iptables), which are marks in packets that are visible only in the server. So you can mark TCP port 80, 443, some other TCP port your app needs, some UDP port, with the same mark and all that transfer will go to the same real server.
[Message sent by forum member 'jarol1' (jarol1)]

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