Nurjan
Nurjan

Reputation: 6073

clustering jsf 2.0 web application

I am going to create an application using jsf 2.x, glassfish 3.1 open source, JPA + postgresql . I want to develop it in such a way, that my app can be clustered on several physical servers and load balanced.

What are the recommended free and open source technologies for clustering and load balancing a jsf 2.0 web application?

What are the best approaches and what should I keep in mind before planning and designing my application?

Any other useful information related to this question is also appreciated )).

Thanks in advance.

Upvotes: 2

Views: 1801

Answers (1)

Adrian Mitev
Adrian Mitev

Reputation: 4752

Glassfish application server has a built-in cluster support. You have to run your application on multiple glassfish instances and configure the server to replicate the data to other server (bind the servers in a cluster).

To enable replication for your application you should put the following tag in web.xml

<distributable />

When the cluster is set up properly the http sessions will be replicated among the cluster nodes. What's left is to configure a load balanced like Apache httpd that will accept requests and route them to a specific server in a cluster.

In general - avoid storing data in the session as much as possible. Make your beans serializable with scope with longer life than request.

Look in google for more information.

Upvotes: 2

Related Questions