Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
dinh ha
Issue with session replicate on seperate Tomcat cluster
8 octobre 2013 21:20
Réponse

dinh ha

Rang: New Member

Publications: 3

Date d'inscription: 2 juin 2013

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.
 1<Proxy balancer://myCluster>
 2    BalancerMember ajp://192.168.1.10:8009 loadfactor=10 route=node1
 3    BalancerMember ajp://192.168.1.14:8009 loadfactor=10 route=node2
 4    ProxySet lbmethod=byrequests
 5</Proxy>
 6<Location / >
 7    ProxyPass balancer://myCluster/ stickysession=JSESSIONID nofailover=Off
 8</Location>
 9
10<Location /balancer-manager>
11    SetHandler balancer-manager
12    Order Deny,Allow
13    Allow from localhost
14    Deny from all
15</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:
 1jdbc.default.url=jdbc:mysql://192.168.1.10/liferay?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
 2jdbc.default.driverClassName=com.mysql.jdbc.Driver
 3jdbc.default.username=root
 4jdbc.default.password=123
 5#setup.wizard.enabled=false
 6
 7cluster.link.enabled=true
 8net.sf.ehcache.configurationResourceName=/myehcache/hibernate-clustered.xml
 9ehcache.multi.vm.config.location=/myehcache/liferay-multi-vm-clustered.xml
10cluster.link.autodetect.address=192.168.1.10:3306
11lucene.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.
Juan Gonzalez
RE: Issue with session replicate on seperate Tomcat cluster
9 octobre 2013 00:30
Réponse

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2169

Date d'inscription: 28 octobre 2008

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:

1<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
RE: Issue with session replicate on seperate Tomcat cluster
9 octobre 2013 01:19
Réponse

dinh ha

Rang: New Member

Publications: 3

Date d'inscription: 2 juin 2013

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
1<distributable/>
to
1$TOMCAT_HOME/webapps/ROOT/WEB-INF/web.xml
, but it not replicate log in session.
dinh ha
RE: Issue with session replicate on seperate Tomcat cluster
9 octobre 2013 20:48
Réponse

dinh ha

Rang: New Member

Publications: 3

Date d'inscription: 2 juin 2013

Publications Récentes

Thanks Juan for helping,
I resolved this problem. I have to configure to cluster for tomcat by using TCP simple cluster.