Forums de discussion

Issue with session replicate on seperate Tomcat cluster

dinh ha, modifié il y a 10 années.

Issue with session replicate on seperate Tomcat cluster

New Member Publications: 3 Date d'inscription: 02/06/13 Publications récentes
Hi all,

I'm deploying High availability on Liferay CE GA2. My architecture include:
- HTTP server use apache http 2.24 with address: 192.168.1.10.
- Liferay on Tomcat server 1 with address: 192.168.1.10.
- Liferay on Tomcat server 2 with address: 192.168.1.14.
- MySQL server with address: 192.168.1.10.
Both liferay use the same database liferay. I'm only test session replication so I don't configure to share jackrabit and document library yet.

On HTTP server, I use mod proxy to load balancing and sticky session.
<proxy balancer: mycluster>
	BalancerMember ajp://192.168.1.10:8009 loadfactor=10 route=node1
	BalancerMember ajp://192.168.1.14:8009 loadfactor=10 route=node2
	ProxySet lbmethod=byrequests
</proxy>
<location>
	ProxyPass balancer://myCluster/ stickysession=JSESSIONID nofailover=Off
</location>

<location balancer-manager>
	SetHandler balancer-manager
	Order Deny,Allow
	Allow from localhost
	Deny from all
</location>

On Both Tomcat, I add <distibutable/> to $TOMCAT_HOME/webapp/ROOT/WEB-INF/web.xml, and add distributable="true" to $TOMCAT_HOME/conf/context.xml. I also add jvmRoute to server.xml on both node.
This's my portal-ext.properties on both Tomcat server:
jdbc.default.url=jdbc:mysql://192.168.1.10/liferay?useUnicode=true&amp;characterEncoding=UTF-8&amp;useFastDateParsing=false
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.username=root
jdbc.default.password=123
#setup.wizard.enabled=false

cluster.link.enabled=true
net.sf.ehcache.configurationResourceName=/myehcache/hibernate-clustered.xml
ehcache.multi.vm.config.location=/myehcache/liferay-multi-vm-clustered.xml
cluster.link.autodetect.address=192.168.1.10:3306
lucene.replicate.write=true


But when I test on scenario testing:
- Bring up both tomcat server.
- Browse to 192.168.1.10 and login as admin.
- Bring down tomcat server which user just login.
- Refresh browser.
When I refresh browser, session of user lost. User loged out.

I figure out on wiki, sticky session only hold user request will alway goes to the same node, while session replication will copied on entire cluster.
So what wrong with my configuration?

Thanks for helping.
thumbnail
Juan Gonzalez, modifié il y a 10 années.

RE: Issue with session replicate on seperate Tomcat cluster

Liferay Legend Publications: 3089 Date d'inscription: 28/10/08 Publications récentes
Hi dinh,

your portal-ext.properties seems ok FOR INDEX REPLICATION, but not for session replication.

For enabling session replication, you have to enable it adding:

<distributable />


to web.xml in your Liferay and portlets WAR files (wherever you want session replication).

You have to enable the session replication in your web server too (Tomcat in your case).

Perhaps you want to take a look at Tomcat documentation
dinh ha, modifié il y a 10 années.

RE: Issue with session replicate on seperate Tomcat cluster

New Member Publications: 3 Date d'inscription: 02/06/13 Publications récentes
Thanks Juan,

On Both Tomcat, I add <distibutable/> to $TOMCAT_HOME/webapps/ROOT/WEB-INF/web.xml, and add distributable="true" to $TOMCAT_HOME/conf/context.xml. I also add jvmRoute to server.xml on both node.


Although I added
<distributable />
to
$TOMCAT_HOME/webapps/ROOT/WEB-INF/web.xml
, but it not replicate log in session.
dinh ha, modifié il y a 10 années.

RE: Issue with session replicate on seperate Tomcat cluster

New Member Publications: 3 Date d'inscription: 02/06/13 Publications récentes
Thanks Juan for helping,
I resolved this problem. I have to configure to cluster for tomcat by using TCP simple cluster.