Search code examples
tomcatazurecluster-computingload-balancingjasperserver

Clustered Tomcat JasperServer in Microsoft Azure Load Balanced Virtual Machines


I would like to know whether it is possible to work with Jasperserver deployed in a clustered Tomcat configured in the Microsoft Azure Load Balanced Virtual Machines ?

Because jasperserver UI always gets crashed because of css/theme not loading in the above environment. I have explained the issue below and I am new to this environment, so please guide me to configure/solve this problem in the above environment.

But the jasper document says, The load balancer must be configured so that browser users are always connected to the same server during a continuous session. Transferring sessions should only happen if a node becomes disabled. Beyond that requirement, JasperReports Server can work with any HTTP load balancer, both hardware or software-based.

The issue is : If only one instance, there is no problem and is working fine because it is maintaining only one JSESSIONID. But if two tomcat in a clustered environment, Jasper UI gets collapsed because css/theme not loading, So I have investigated the request and response, more than one JSESSIONID involved and I don't know this issue is because of load balancer or session management of jasper, so please guide me to solve this problem.

Note: Sorry, for my bad english and Thanks in advance for reading and answering my question. Every comment/idea is highly appreciated.

Error :

Failed to load resource: the server responded with a status of 404 (Not Found) https://domain.test/jasperserver-pro/_themes/C7141728/theme.css Failed to load resource: the server responded with a status of 404 (Not Found) https://domain.test/jasperserver-pro/_themes/C7141728/pages.css etc...

Environment : 1) Jasperserver 5.5 Commercial edition with session replication. 2) Two apache-tomcat-6.0.36 clustered instance. 3) Linux Machine - Ubuntu 13.10 Server.

Thanks, Loganathan.


Solution

  • As per your description, JasperServer requires session affinity. The Azure load balancers do not support session affinity (as of today). This is the reason why your application doesn't work. You have the following ways to solve your problem: 1. Ideally, find if Jasper supports storing session out of process (ex. in the database). I don't know Jasper, but in IIS you have a way to change that by configuration. This way, no matter where the query comes, the web server will look for the session info in the database. 2. Install a web role with a request routing module in front of your application. The easiest way is to use ARR (Application Request Routing), as described in this article: http://coderead.wordpress.com/2011/11/11/using-azurearr-sticky-sessions-in-azure/ . It will definitely work; but it will cost you more (a couple of new small VMs). Hope it helped, Marius