Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Gunta Dalecka
session.shared.attributes not working in cluster
November 11, 2013 2:25 AM
Answer

Gunta Dalecka

Rank: New Member

Posts: 4

Join Date: November 7, 2013

Recent Posts

When trying to configure cluster using Liferay 6.1.2 CE, I fail to get session replication working. Tried also setting up cluster with Terracota following step-by-step described in how-do-i-cluster-liferay-with-terracotta, but it looks, that session.shared.attributes setting in portal-ext.properties is ignored. How to get it working?

Are there any fresh guidelines on setting up cluster suitable for Liferay 6.1.2 CE available? Whitepaper "Advanced Liferay Architecture-Clustering and High Availability" is pretty old and Ehcache configuration changes have been since then. Is cluster with session replication using CE possible at all?

I experimented also with EE trial, but I didn't see any cluster/cache/terracota related plugins in spite I've read in forums about it.
Juan Gonzalez
RE: session.shared.attributes not working in cluster
November 11, 2013 3:58 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2795

Join Date: October 28, 2008

Recent Posts

I Gunta,

your problem probably it's caused by a misconfiguration of your app server cluster. Depending on which server are you using, you should do different operations.

For example. these are the instructions for enabling in Tomcat:

http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html#Cluster_Basics
Gunta Dalecka
RE: session.shared.attributes not working in cluster
November 11, 2013 6:25 AM
Answer

Gunta Dalecka

Rank: New Member

Posts: 4

Join Date: November 7, 2013

Recent Posts

Juan,
thanks for your soon answer. Yes, I am using Liferay bundled with Tomcat.
I'm familiar with this article, but will go through it once again.

Do you mean, that it should be possible to get session replication working with Community Edition Liferay bundled with Tomcat?

From forums I see people got it working with Liferay 6.0, but I'm not so sure about Liferay 6.1.2, that I am using.
Juan Gonzalez
RE: session.shared.attributes not working in cluster
November 11, 2013 6:32 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2795

Join Date: October 28, 2008

Recent Posts

Gunta Dalecka:

Do you mean, that it should be possible to get session replication working with Community Edition Liferay bundled with Tomcat?


Of course! I tried it some weeks ago, and guess it was using a just-pre-6.1.2-sources, so it should work.

First you can try the session replication simply by login to Liferay, and see if accesing to other node (using a load balancer, for example, to mantain the URL so cookies persist after accessing both nodes) works. After that you can try the shared attributes property.
Krzysztof Gołębiowski
RE: session.shared.attributes not working in cluster
November 11, 2013 11:15 AM
Answer

Krzysztof Gołębiowski

Rank: Liferay Master

Posts: 508

Join Date: June 25, 2011

Recent Posts

I've clustered both 6.0 and 6.1 and everything worked fine. Clustering sessions is actually not Liferay responsibility but Application Server (Tomcat in this case). To test it you can put JSP file to webapps/ROOT (or even deploy new WAR file) printing out session ID - out.println(" ID " + session.getId());. If cluster is working properly, page rendered on both nodes should display the same ID.

We tried Terracota for clustering ehcache and there were lot of problems. Currently I don't know any working production installation.
Mikhail Zheludev
RE: session.shared.attributes not working in cluster
January 17, 2014 6:43 AM
Answer

Mikhail Zheludev

Rank: Junior Member

Posts: 43

Join Date: January 8, 2013

Recent Posts

Krzysztof,
Yes, it is true, can get the same session ID in LR-worker2, and even authenticated user from session, but cannot get session attribute in LR-worker2, which was put from LR-worker1. Did you try this case?