Liferay is a Gartner Magic Quadrant Leader for the Sixth Year! Find out why

Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
xun ren
Delete user on Cluster
June 21, 2012 1:23 AM
Answer

xun ren

Rank: Junior Member

Posts: 82

Join Date: April 1, 2008

Recent Posts

Hello,

I am developping under Liferay 5.2.3 CE. I've taken a look at the source of this version that every time we delete a user, it will call the UserIndexer to delete the index and empty the permissoin cache.

Like this :
1UserIndexer.deleteUser(user.getCompanyId(), user.getUserId());


Behind this code, in the class, in the "com.liferay.portlet.enterpriseadmin.util.UserIndexer" class,
1SearchEngineUtil.deleteDocument(companyId, getUserUID(userId));
is called.

Question : Is the delete of index/document of user is done on all of the instances of my application server on cluster. For example, we have four instances of JBoss Server. We encountered a problem of indexation and on the four different instances, the total of users is not the same.

If the delete of index is only done on the current instance of JBoss, what can we do to make it happen on the other instances, too ? If we need to update the version of Liferay, then which version minimum should we choose ?

Thanks a lot.
Amos Fong
RE: Delete user on Cluster
June 21, 2012 2:11 AM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1886

Join Date: October 7, 2008

Recent Posts

Hi,

Do you have this property set?

1    #
2    # Set this to true if you want the portal to replicate an index write across
3    # all members of the cluster. This is useful in some clustered environments
4    # where you wish each server instance to have its own copy of the Lucene
5    # search index. This is only relevant when using the default Lucene indexing
6    # engine.
7    #
8    lucene.replicate.write=false


I assume you have cluster.link.enabled too right?
Sandeep Nair
RE: Delete user on Cluster
June 21, 2012 2:21 AM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1721

Join Date: November 5, 2008

Recent Posts

Hi,

Since you are using Liferay 5.2.3, I am not sure if cluster link was supported in that version.

The possible ways in 5.2.3 as far as I remember was

Storing index in database(Not recommended)
Storing lucene indexes in SAN (Not recommended)
Solr (Recommended but would require separate solr server)
Hitoshi Ozawa
RE: Delete user on Cluster
June 21, 2012 3:28 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

If you don't have performance problem, another choice is to disable indexing on user (i.e.. users.search.with.index=true
I'm not sure if this feature was implemented in which version

http://issues.liferay.com/browse/LPS-3543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
xun ren
RE: Delete user on Cluster
June 22, 2012 8:09 AM
Answer

xun ren

Rank: Junior Member

Posts: 82

Join Date: April 1, 2008

Recent Posts

Amos Fong:
Hi,

Do you have this property set?

1    #
2    # Set this to true if you want the portal to replicate an index write across
3    # all members of the cluster. This is useful in some clustered environments
4    # where you wish each server instance to have its own copy of the Lucene
5    # search index. This is only relevant when using the default Lucene indexing
6    # engine.
7    #
8    lucene.replicate.write=false


I assume you have cluster.link.enabled too right?



Hi, It seams that, in the version 5.2.3 CE, there is no properties "cluster.link.enabled" or "lucene.replicate.write". It exists in the versions after.
So the answer is we do not have these properties set.

Thanks a lot.
xun ren
RE: Delete user on Cluster
June 22, 2012 8:12 AM
Answer

xun ren

Rank: Junior Member

Posts: 82

Join Date: April 1, 2008

Recent Posts

Sandeep Nair:
Hi,

Since you are using Liferay 5.2.3, I am not sure if cluster link was supported in that version.

The possible ways in 5.2.3 as far as I remember was

Storing index in database(Not recommended)
Storing lucene indexes in SAN (Not recommended)
Solr (Recommended but would require separate solr server)


Yes, you are right. Cluster link doesn't exist in this version. We've considerated to use the first two options you refered above. But why it is not recommended ?
I don't know what is "Solr". Could please explain me a bit ? Thanks a lot.

Denis.
xun ren
RE: Delete user on Cluster
June 22, 2012 8:16 AM
Answer

xun ren

Rank: Junior Member

Posts: 82

Join Date: April 1, 2008

Recent Posts

Hitoshi Ozawa:
If you don't have performance problem, another choice is to disable indexing on user (i.e.. users.search.with.index=true
I'm not sure if this feature was implemented in which version

http://issues.liferay.com/browse/LPS-3543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel



Hi, it seems that, it is found in Liferay 5.2.3 CE, but the correction is commited for the enterprise edition. There is no support for CE. Right ?
Sandeep Nair
RE: Delete user on Cluster
June 22, 2012 7:11 PM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1721

Join Date: November 5, 2008

Recent Posts

xun ren:


Yes, you are right. Cluster link doesn't exist in this version. We've considerated to use the first two options you refered above. But why it is not recommended ?
I don't know what is "Solr". Could please explain me a bit ? Thanks a lot.

Denis.


1) It can be very slow if you store lucene indexes in database and lots of db space used in there
2) If two processes write to the same index file in SAN, sometimes it may cause problem as lucene does not guarantee the integrity. But again it all depends on SAN providers, because some do handle such situations.

Regards,
Sandeep
Hitoshi Ozawa
RE: Delete user on Cluster
June 23, 2012 5:12 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

I was getting time out on one of the server when I tried to save index in a database and did a reindex.

When using SAN, it's necessary to use one that do version control.