掲示板

How do I fix Session/Cache/Search replication for LR on Glassfish Cluster?

thumbnail
11年前 に Dave F によって更新されました。

How do I fix Session/Cache/Search replication for LR on Glassfish Cluster?

Junior Member 投稿: 30 参加年月日: 13/01/29 最新の投稿
I have Liferay EE 6.1.20 deployed to Oracle Glassfish Server 3.1.2.2. There are two instances set up, and Liferay is deployed to both. Liferay seems to work fine on them individually.

When I add <distributable /> to the web.xml for each Liferay instance, I get some strange behaviour:

I am intermittently but frequently prompted to log in again. I have enabled cache and search replication, but neither of these appear to be working as well.

In the server log, I get several lines of the following message (each referring to a different skipped cacheable item):
15:15:55,587 DEBUG [http-thread-pool-28080(4)][ConfigurationHelper:38] CacheDecoratorFactory not configured for defaultCache. Skipping for 'com.liferay.portal.kernel.dao.orm.FinderCache.com.liferay.portlet.mobiledevicerules.model.impl.MDRRuleGroupInstanceImpl.List2'.


I appreciate any advice. Thanks!
thumbnail
11年前 に Juan Gonzalez によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Did you enable replication in Glassfish console?
thumbnail
11年前 に Dave F によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Junior Member 投稿: 30 参加年月日: 13/01/29 最新の投稿
I've done the following to enable cache replication:

Enabled 'Availability' on the deployed Liferay application in the Glassfish console

Added the following to my portal-ext.properties file:

[indent]cluster.link.enabled=true
ehcache.cluster.link.replication.enabled=true[/indent]

Added the following to my web.xml file (inside the <web-app> tags at the very top):

[indent]<distributable />[/indent]

Any thoughts?
thumbnail
11年前 に Juan Gonzalez によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Well, this seems to be a session replication, hence Glassfish problem.

Can you try deploying clusterjsp EAR file that should be in glassfish directory?


http://glassfish.java.net/javaee5/build/GlassFish_LB_Cluster.html#deploy

After that, check that session and attributes are replicating to all nodes.
thumbnail
11年前 に Dave F によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Junior Member 投稿: 30 参加年月日: 13/01/29 最新の投稿
Thanks Juan,

I deployed the clusterjsp application, and it looks like session replication is not working with it as well.

Thanks for getting me pointed in the right direction. I'll focus on troubleshooting Glassfish session replication.
thumbnail
11年前 に Juan Gonzalez によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Glad I helped emoticon
thumbnail
10年前 に Dave F によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Junior Member 投稿: 30 参加年月日: 13/01/29 最新の投稿
Hi Juan, I hope you're still watching this thread.

I've resolved my issue with Glassfish session replication -- Session values are now replicated to both nodes, and the clusterjsp application works as expected.

I am still not able to get session replication to work in Glassfish, however. When I access an individual instance, it works fine, but when I access them through the load balancer (Apache HTTPD/mod_proxy) I cannot log in. I am just returned to the login page.

The only thing I have noticed which appears strange in the logs is the following entry:
WARN org.quartz.simpl.PropertySettingJobFactory - No setter on Job class com.liferay.portal.scheduler.job.MessageSenderJob for property 'JOB_STATE'


Several of these messages appear, but only in the log for instance 1.
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hi Dave,

Ok so now you only have to add <distributable/> to web.xml file in liferay WAR.

After that, you should configure cluster link to enable indexes and hibernate cache in cluster.
thumbnail
10年前 に Dave F によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Junior Member 投稿: 30 参加年月日: 13/01/29 最新の投稿
Thanks Juan.

I do have those entries in my web.xml and my portal-ext.properties file respectively. Liferay still doesn't maintain my session while logged in, however. I am automatically logged out when I try to go to a different page, or go into the control panel.

Here are the contents of my web.xml and portal-ext.properties (in case there is something else I've missed):


<!--?xml version="1.0"?-->

<web-app id="Liferay_Portal" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
	<distributable />
	<context-param>

...
</context-param></web-app>


I had to truncate the file above to get this message to post, but I can add the rest or specific sections in another message if it will help. Really, it should be all the default web.xml content that comes with the standalone Liferay download.

# This document will be a catch-all reference for properties entries used throughout setup of the 
# portal.
#
# It is not intended to be used in it's entirety, but to provide code 'snippets' to be copied and 
# pasted into the portal-ext.properties file as needed

# Enable session replication for search index and cache replication
cluster.link.enabled=true

# Enable search index replication in particular (requires cluster.link.enabled=true above)
lucene.replicate.write=true

# Enable cache replication for ehcache in particular (requires cluster.link.enabled=true above)
ehcache.cluster.link.replication.enabled=true

# Cluster link attempts to ping an address (any address) to verify that the cluster is available.
# By default it uses www.google.com:80 but the setting below can be used to override the address 
# used.
cluster.link.autodetect.address=x.x.x.x:22

# Makes the jdbc/LiferayPool database pool available in Liferay.  The pool must be preconfigured in
# the application server (Glassfish)
jdbc.default.jndi.name=jdbc/LiferayPool

# Updates the context root used by the portal when doing redirection after login, etc.  Should match
# the context root set for the portal in the application server (Glassfish)
portal.ctx=/portal


FYI: The redacted clusterlink autodetect address above is a host on the internal network which is reachable by SSH (hence, using port 22). This needed to be changed because the server does not have direct access to the internet, so it can't reach www.google.com:80.

I appreciate the help!
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Dave F:

Liferay still doesn't maintain my session while logged in, however. I am automatically logged out when I try to go to a different page, or go into the control panel.


You said you're logged out when going to another page. But, is this still happening while in the same host you logged in? What are the URL used (IP, domain)?

It could be a good thing if you can get the HTTP headers sequence using firebug to see what is happening between server and your browser.
thumbnail
10年前 に Dave F によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Junior Member 投稿: 30 参加年月日: 13/01/29 最新の投稿
It looked like each request would be assigned a new session ID.

We are currently putting the proof-of-concept with Glassfish on hold for now, and will be trying out Tomcat to see if it might be a better alternative for us.

Thank-you for the help, Juan
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Did you check if JSESSIONID cookie from your browser to server is the same in the second request?

Are you using some kind of load balancer/proxy (apache, etc) ?
thumbnail
10年前 に Dave F によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Junior Member 投稿: 30 参加年月日: 13/01/29 最新の投稿
Using Apache with mod_proxy for load balancing.

The JSESSIONID cookie was present, but it had a new value with each request.
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
So seems that can be the issue.

Are you sure you configured properly Apache to work with JSESSIONID cookies?

You can try configuring some portal-ext.properties. like:

session.enable.url.with.session.id (if you see JSESSIONID is in your URL)

web.server.* (there are some of them)

redirect.url.*

I don't have much experience using Apache. I used haproxy without any problem.
thumbnail
10年前 に Dave F によって更新されました。

RE: How do I fix Session/Cache/Search replication for LR on Glassfish Clust

Junior Member 投稿: 30 参加年月日: 13/01/29 最新の投稿
I'll give it a try and see what happens.

Thanks again!