掲示板

Liferay Clustered Environment

thumbnail
13年前 に Sandeep Nair によって更新されました。

Liferay Clustered Environment

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
Hi,

I have a requirement that i setup a clustered env which has 2 apache web servers load balanced, 2 Liferay instances(Tomcat bundle) clustered and 2 database servers

I have previously tried setting up clustered environment which has two tomcats and 1 apache web server.

Can anyone plz suggest me what to do to have my clustered environment setup. I want to do this all in my local machine first. So is it possible to have two apache web servers running on same box and how to make them load balanced. It would be awesome if someone mentioned the exact steps to do in local than pointing to some google link, (i dont mind google links as long as they have exact steps that i can follow to achieve the above).

Regards,
Sandeep
thumbnail
13年前 に Olaf Kock によって更新されました。

RE: Liferay Clustered Environment

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Are you sure you need this duplication on all levels? Usually there's a single layer that requires more performance than the others.

Running two apaches with two tomcats (liferays): Should each Apache loadbalance to both tomcats or is it supporse to be frontend to only one tomcat? However - it shouldn't make a big difference compared to the known configuration with tomcat either way. The loadbalancer would probably be sepate though (in front of the Apaches)

Database clustering and how you best do that depends a lot on your database (and your budget). From Liferay's point of view a DB cluster should (ideally) appear as a single database.

Other than (your need to) answering these two questions I can't see more things to apapt to the current standard clustering approach - at least not immediately without doing it myself.
thumbnail
13年前 に Sandeep Nair によって更新されました。

RE: Liferay Clustered Environment

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
Thanks Olaf for reply.

DB clustering i can manage. i will configure one db for write and one db for read and write.

Yes apache is the pain here. The client wants two apaches for High availability and failover. So if one web server fails they want the second to handle things and yes they would want to utilize two web server for loadbalancing to each available instance of tomcat.

Regards,
Sandeep
thumbnail
13年前 に Syed Mudassir Ali によって更新されました。

RE: Liferay Clustered Environment

New Member 投稿: 10 参加年月日: 10/11/29 最新の投稿
Hi
Iam using tomcat bundled with liferay 6.0.5 in a clusttered environment.and trying to cache serializable objects with MultiVMPoolUtil (EHCache).

To my surprise i was able to replicate String,ArrayList put in cache in second server but, serializable objects put in cache donot get replicated in second server.

Your help will be appreciated.
Thanks in Advance.
thumbnail
13年前 に Sandeep Nair によって更新されました。

RE: Liferay Clustered Environment

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
Hi Olaf,

I was able to set up a clustered load balanced environment in my local. It has one database, two tomcat and one apache.

Here are the properties that i added in portal-ext.properties
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/cluster_write?useUnicode=true&characterEncoding=UTF8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root

#Ehcache
net.sf.ehcache.configurationResourceName=/ehcache/hibernate-clustered.xml
ehcache.multi.vm.config.location=/ehcache/liferay-multi-vm-clustered.xml

#documentlibrary
dl.hook.impl=com.liferay.documentlibrary.util.AdvancedFileSystemHook
image.hook.impl=com.liferay.portal.image.DLHook

image.hook.file.system.root.dir=E:/Practice/Liferay/clusterTesting/data/images
dl.hook.file.system.root.dir=E:/Practice/Liferay/clusterTesting/data/document_library

lucene.dir=E:/Practice/Liferay/clusterTesting/data/lucene/
#cluster.link.enabled=true
#web.server.display.node=true


For apache I enabled following

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

And in httpd-vhosts.conf added the following

<virtualhost *:80>
	ServerName node1.liferay.com
	ErrorLog logs/ajperror.log
	CustomLog logs/ajp.log combined
	
	<proxy *>
		AddDefaultCharSet Off
		Order deny,allow
		Allow from all
	</proxy>
	ProxyPass /balancer-manager !
	ProxyPass / balancer://ajpCluster/ stickysession=JSESSIONID
	ProxyPassReverse / balancer://ajpCluster/ stickysession=JSESSIONID
	<proxy balancer: ajpcluster>
		BalancerMember ajp://localhost:8009 route=lr1
		BalancerMember ajp://localhost:9009 route=lr2
		ProxySet lbmethod=byrequests
	</proxy>
	
	<location balancer-manager>
		SetHandler balancer-manager
		Order deny,allow
		Allow from all
	</location>
</virtualhost>


It works fine but i have some questions to you

1) How to add another apache?
2) I tried to make database in read write mode by putting the following but it tried to put data in write database and for read it was trying to use hypersonic. Is it becoz that i havent enabled replication first that it happend that way?

spring.configs=\
        META-INF/base-spring.xml,\
        \
        META-INF/hibernate-spring.xml,\
        META-INF/infrastructure-spring.xml,\
        META-INF/management-spring.xml,\
        \
        META-INF/util-spring.xml,\
        \
        META-INF/jpa-spring.xml,\
        \
        META-INF/audit-spring.xml,\
        META-INF/cluster-spring.xml,\
        META-INF/editor-spring.xml,\
        META-INF/jcr-spring.xml,\
        META-INF/ldap-spring.xml,\
        META-INF/messaging-core-spring.xml,\
        META-INF/messaging-misc-spring.xml,\
        META-INF/poller-spring.xml,\
        META-INF/rules-spring.xml,\
        META-INF/scheduler-spring.xml,\
        META-INF/scripting-spring.xml,\
        META-INF/search-spring.xml,\
        META-INF/workflow-spring.xml,\
        \
        META-INF/counter-spring.xml,\
        META-INF/document-library-spring.xml,\
        META-INF/mail-spring.xml,\
        META-INF/portal-spring.xml,\
        META-INF/portlet-container-spring.xml,\
        \
        META-INF/dynamic-data-source-spring.xml,\
        #META-INF/shard-data-source-spring.xml,\
        #META-INF/memcached-spring.xml,\
        #META-INF/monitoring-spring.xml,\
        \
        META-INF/ext-spring.xml

jdbc.read.driverClassName=com.mysql.jdbc.Driver
jdbc.read.url=jdbc:mysql://localhost/cluster_read?useUnicode=true&amp;characterEncoding=UTF8&amp;useFastDateParsing=false
jdbc.read.username=root
jdbc.read.password=root

jdbc.write.driverClassName=com.mysql.jdbc.Driver
jdbc.write.url=jdbc:mysql://localhost/cluster_write?useUnicode=true&amp;characterEncoding=UTF8&amp;useFastDateParsing=false
jdbc.write.username=root
jdbc.write.password=root


4) we will be using SAN for file storage. Is it advisable to use cluster link for lucene or can i use SAN for the same? If i go for cluster link, will just setting cluster.link.enabled to true, make it start working or do i need to do some more change.

5) While using SAN for example in my case above the following should work rright?

dl.hook.file.system.root.dir=//SAN_IP/cluster/data/document_library
thumbnail
13年前 に Olaf Kock によって更新されました。

RE: Liferay Clustered Environment

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Sandeep Nair:
Hi Olaf,

I was able to set up a clustered load balanced environment in my local. It has one database, two tomcat and one apache.

...

It works fine but i have some questions to you

1) How to add another apache?


I would expect a second apache to be added exactly the same way. I wouldn't expect that there are any problems with tomcat when there are more apaches in front. It's ok when there are a lot of clients for a webserver - so it should be with the proxy. I've never done this, but this is my expectation. Have you tried it and ran into specific problems?

Sandeep Nair:

2) I tried to make database in read write mode by putting the following but it tried to put data in write database and for read it was trying to use hypersonic. Is it becoz that i havent enabled replication first that it happend that way?


I don't really understand what you're saying here. Write to mysql and read from hsql? Please check if your properties configuring this access are correct and if you got all steps. This is in the admin documentation (I believe). I'd have to look it up just as you do.

Sandeep Nair:

4) we will be using SAN for file storage. Is it advisable to use cluster link for lucene or can i use SAN for the same? If i go for cluster link, will just setting cluster.link.enabled to true, make it start working or do i need to do some more change.


There's a lot of options. If you're on 5.2.x, the property is enough. On 6.0.x you need one more property, as clusterlink is now used for more than just indexing-clusters: lucene.replicate.write=true

Please read the admin documetation on the alternatives. ClusterLink is easy to set up, but requires re-indexing once you bring a server online, as every server has its own index. If you can live with this, it's fine, but you have to know this.

Sandeep Nair:

5) While using SAN for example in my case above the following should work rright?

dl.hook.file.system.root.dir=//SAN_IP/cluster/data/document_library


I'd expect it to work - somebody else should comment if it doesn't. I'm a bad SAN reference. However, placing documentlibrary on a SAN is recommended.
While you're at it: Remember ImageGallery
thumbnail
13年前 に Sandeep Nair によって更新されました。

RE: Liferay Clustered Environment

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
Hi Olaf,

Thanks for the reply. What i wanted to say for database was. I set the properties that need to be set up for read write config, and have 2 databases created in mysql for writing and reading and mentioned those in portal-ext.properties.

Now what happens when i start liferay up is it populates the the database that is configured for write in Mysql and then it starts to throw up exceptions for database that is configured for read and then start Hypersonic database by default. Is it because i havent configured replication in database before doing this?

Regards,
Sandeep
thumbnail
11年前 に Sreeraj AV によって更新されました。

RE: Liferay Clustered Environment

Regular Member 投稿: 239 参加年月日: 10/04/27 最新の投稿
Sandeep Nair:
Hi Olaf,

Thanks for the reply. What i wanted to say for database was. I set the properties that need to be set up for read write config, and have 2 databases created in mysql for writing and reading and mentioned those in portal-ext.properties.

Now what happens when i start liferay up is it populates the the database that is configured for write in Mysql and then it starts to throw up exceptions for database that is configured for read and then start Hypersonic database by default. Is it because i havent configured replication in database before doing this?

Regards,
Sandeep



can u please explain how you configured two apache web servers ? I have 4 machines, 2 for tomcat severs and 2 for apache web servers.