Fórumok

Autodeploy, glassfish, cluster

Jason Czerak, módosítva 15 év-val korábban

Autodeploy, glassfish, cluster

New Member Bejegyzések: 23 Csatlakozás dátuma: 2008.05.01. Legújabb bejegyzések
So, I figured out my auto deploy issues with glassfish on a cluster server env.

In a nut shell, upload the .war to liferay, this way it knows a something is on it's way via the auto deploy.

Copy the .war to the admin server's auto deploy directory.

Fire up the admin gui on the admin server and re-target the .war to the correct cluster.

profit.



few questions, I have yet to get a full cluster "working" yet, but I think there may be problems if I don't do step one one each clustered server individually first.

Second, I'm currently searching google, but glassfish puts the file in the clustered server's autodeploy, and that does nothing. Not sure how to enable that on glassfish yet, if it's even possible.

And further yet, how would I tell the system what cluster the autodeploy is for? is it in the "name" of the file?
thumbnail
Raju Uppalapati, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

Junior Member Bejegyzések: 66 Csatlakozás dátuma: 2007.10.24. Legújabb bejegyzések
Jason,
A simple solution I can think of is:
1. Maintain a staging domain of Glassfish (non clustered and default install). Preferably on your dev box.
2. Deploy your developed Portlet onto this Liferay instance from the hotdeploy directory.
3. Copy/FTP the modified Portlet WAR file that liferay creates in the glassfish auto deploy directory to the host where your cluster Domain Admin Server is running.
4. Execute asadmin: asadmin deploy --target cluster1 myPortlet.war
5. This command will transfer this WAR to all the remote and local instance part of this cluster and deploy it on each of them.

If you undeploy the portlet form the cluster (via admin console or cli), Liferay will detect that its gone and remove references from it.

We are starting work in publishing a Wiki Article for running Liferay on a Glassfish + MySQL cluster.
Would you like to participate in it?

thanks,
_raju

PS: I have not tried the above instructions but theoretically they will work. If you run into trouble please feel free to post your experience.
Jason Czerak, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

New Member Bejegyzések: 23 Csatlakozás dátuma: 2008.05.01. Legújabb bejegyzések
Raju Uppalapati:
Jason,
A simple solution I can think of is:
1. Maintain a staging domain of Glassfish (non clustered and default install). Preferably on your dev box.
2. Deploy your developed Portlet onto this Liferay instance from the hotdeploy directory.
3. Copy/FTP the modified Portlet WAR file that liferay creates in the glassfish auto deploy directory to the host where your cluster Domain Admin Server is running.
4. Execute asadmin: asadmin deploy --target cluster1 myPortlet.war
5. This command will transfer this WAR to all the remote and local instance part of this cluster and deploy it on each of them.

If you undeploy the portlet form the cluster (via admin console or cli), Liferay will detect that its gone and remove references from it.

We are starting work in publishing a Wiki Article for running Liferay on a Glassfish + MySQL cluster.
Would you like to participate in it?

thanks,
_raju

PS: I have not tried the above instructions but theoretically they will work. If you run into trouble please feel free to post your experience.


Well, My cluster will be on PostgreSQL. PostgreSQL it self will be a Master master cluster.

I'd love to help as much as I can.

My other problem with Liferay is the fact that you can not run 2 instances of it under one domain. Not all JNDI name references are in .xml files that I can change with out editing source.

In my example of how I got the deploy to work in my first post, I skipped hte steps of the copy to the admin server and drop in the autodeploy (and retarget). But manually deployed hte war file to the cluster

Example:

Upload .war file to liferay. allow it to realize a new .war file is on it's way.

Take the same .war file I uploaded from my desktop, and did a manual deploy via the Glassfish GUI to the cluster. Liferay failed to pick it up.

Does it modify the .war file when you pass it though the liferay autodeploy process?

Gota keep in mind here that I (admins) will not be deploying these .war files. I suppose a scheduled job could take care of hte copy and deploy via the CLI. I was looking for something more graceful, but if liferay doesn't fully do everything with clusters in mind, there's really not much I can.

Your suggestions will be tried out and considered.
Jason Czerak, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

New Member Bejegyzések: 23 Csatlakozás dátuma: 2008.05.01. Legújabb bejegyzések
Are sessions persistent between the clustered servers? if I kill on server, would my session still be alive on the other on the next browser click (though a load balancer)
thumbnail
Raju Uppalapati, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

Junior Member Bejegyzések: 66 Csatlakozás dátuma: 2007.10.24. Legújabb bejegyzések
HTTP Session failover is a feature of the opensrc Glassfish Application Server V2 (latest is V2 Update 2)
The following doc describes how. AFAIK Glassfish does in memory session replication.
https://glassfish.dev.java.net/javaee5/build/GlassFish_LB_Cluster.html

_raju
Jason Czerak, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

New Member Bejegyzések: 23 Csatlakozás dátuma: 2008.05.01. Legújabb bejegyzések
awesome. thank you.

As far as hibernate, these settings look sufficient?

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


I'm going to start working on the other 3 things that need to get migrated to JDBC to get everthing fully clusteres and not on the file system.
Jason Czerak, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

New Member Bejegyzések: 23 Csatlakozás dátuma: 2008.05.01. Legújabb bejegyzések
I've successfully been able to use "clusterjsp" and test availability. this works just fine between clustered servers..

However, I'm still having issues with liferay! What additional configuration is required for the sessions? I installed the modules necessary, checked "availability" and even placed "<distributable/>" with in the web and sun-web.xml files. All availability configurations are set to "replicate".

Are there JMS queue's and what not that need special attention?

From the tomcat docs, it appears as if I just need that one tag in the web.xml.
Jason Czerak, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

New Member Bejegyzések: 23 Csatlakozás dátuma: 2008.05.01. Legújabb bejegyzések
One last tib bit of info before I give up for the day on this.

[#|2008-06-20T15:21:37.177-0500|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;/clusterjsp;replicated;web-method;modified-attribute;|WEB0130: Enabling ha-based persistence for web module [/clusterjsp]'s sessions: persistence-type = [replicated] / persistenceFrequency = [web-method] / persistenceScope = [modified-attribute]|#]


shows up for the test app.

Does not show up for liferay when it starts to load.
Jason Czerak, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

New Member Bejegyzések: 23 Csatlakozás dátuma: 2008.05.01. Legújabb bejegyzések
Not giving up yet!

I decided to break down and un-jar the .war file. exit web.xml, re-jar up the .war file, re-deploy the application.

BINGO!

I got the WEB0130: Enabling ha-based persistence for the [ ] context... I assumed root there.. and bring up and down jvm's everything works as expected.

For some reason, My sessions randomly get reset. no reason... A few times I was able to keep a session open between a restart of each clustered server. everything worked as expected...

Connect to LBed IP, figure what server we are really on based on log activity. Kill that server, ensure session still active. bring up that server and then kill the other... This worked like twice. however now I'm only able to get may be one or two clicks with in the portal and I get kicked back to the logon page.

ideas on that part?

This even happens when I connect directly to a clustered server, by passing the load balancer.
thumbnail
Raju Uppalapati, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

Junior Member Bejegyzések: 66 Csatlakozás dátuma: 2007.10.24. Legújabb bejegyzések
I am assuming you added the <distributable/> tag above the filters to the web.xml of the liferay-portal.war which is used for storing session variable.

Also ensure that the Availability option is selected for both liferay-portal.war and the portlet.war files.

1. Log in to administration console of Application Server.
2. Click Web applications -> liferay-portal.
3. Select the Availability option in the right panel.
Jason Czerak, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

New Member Bejegyzések: 23 Csatlakozás dátuma: 2008.05.01. Legújabb bejegyzések
This isn't working so much. I added a few more "<distributable/>"'s but doesn't appear to work. there are no other .war files deployed to the system as of yet.


I'm unable to log into a clustered server directly and maintain sessions. I'm wondering if the hibernate settings are mucked up?
Jason Czerak, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

New Member Bejegyzések: 23 Csatlakozás dátuma: 2008.05.01. Legújabb bejegyzések
I did some more testing an ensuring today.

I have the correct tags in the web.xml file

When I have "availability" turned on, Even if I go directly to the clustered server, my state/session fails after the first or second click with in the site. just drops be back to the sign in page.. If I turn this off, the site works fine!

This is with and with out the ehcache stuff enabled with in "portal-ext.properties" file.

Then I tried:

resource.repositories.root=/home/gfish/liferay
;javascript.fast.load=true
;lucene.dir=${resource.repositories.root}/lucene/
;jcr.jackrabbit.repository.root=${resource.repositories.root}/jackrabbit
auto.deploy.dest.dir=/opt/glassfish/domains/qa/autodeploy
ehcache.multi.vm.config.location=/home/gfish/liferay/ehcache/liferay-multi-vm-clustered.xml
net.sf.ehcache.configurationResourceName=/home/gfish/liferay/ehcache/hibernate-clustered.xml


and copied the .xml files outa the .generated directory to ensure the paths were working. no change

Does anyone have a suggestion of what logging I should increase to try to pin point what it happening?
Ravi Jagtap, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

New Member Bejegyzés: 1 Csatlakozás dátuma: 2009.04.03. Legújabb bejegyzések
Hi Jason,

Have you solved the problem, I am also getting the same problem, my application throws me out after 2-3 clicks.
I have glassfish cluster with 3 instances in it, availibility is also true.
and my sun-web.xml reads
.......
<session-manager persistence-type="replicated">
<manager-properties>
<property name="persistenceFrequency" value="web-method"/>
</manager-properties>
<store-properties>
<property name="persistenceScope" value="session"/>
</store-properties>
</session-manager-->
.....

but the application works if I change it to
......
<session-manager persistence-type="memory">
<manager-properties>
<property name="sessionFilename" value="some path" />
</manager-properties>
</session-manager>
.....
but then failover doesnt works.
I have googled a lot but cant find anything...
Please let me know what is missing.
Srikanth Konjarla, módosítva 15 év-val korábban

RE: Autodeploy, glassfish, cluster

Junior Member Bejegyzések: 51 Csatlakozás dátuma: 2008.10.25. Legújabb bejegyzések
You need GlassFish version 2.1 with Patch 1 which addresses few session replication issues if you are deploying on GlassFish version 2.1.

Issue #7200 - HttpSession object not created from replicated data on new primary node
https://glassfish.dev.java.net/issues/show_bug.cgi?id=7200

Also, you need to update the sun-web.xml to support AJAX calls when deployed in cluster. Here is the sample. Please note that inclusion of "relaxCacheVersionSemantics" key.

<?xml version="1.0"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet
2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">
<sun-web-app>
<context-root>portal</context-root>
<class-loader delegate="true" />
<session-config>
<session-manager persistence-type="replicated">
<manager-properties>
<property name="persistenceFrequency" value="web-method"/>
<property name="relaxCacheVersionSemantics" value="true"/>
</manager-properties>
<store-properties>
<property name="persistenceScope" value="session"/>
</store-properties>
</session-manager>
<session-properties/>
<cookie-properties/>
</session-config>
</sun-web-app>
K V Dev, módosítva 13 év-val korábban

RE: Autodeploy, glassfish, cluster

New Member Bejegyzések: 2 Csatlakozás dátuma: 2010.09.14. Legújabb bejegyzések
Hi Raju,
I have Glassfish cluster and Liferay with 2 instances. I am trying to deply a portlet via liferay but it doesnt seem to go beyond "Deployment will start in a few seconds". Have googled everything but without any luck. I am new to liferay and glassfish both. Any thoughts

[#|2010-09-14T15:06:32.687+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=com.liferay.portal.kernel.deploy.auto.AutoDeployScanner;|15:06:32,687 INFO [AutoDeployDir:167] Processing transaction-viewer-portlet-1.0.0.2.war
|#]

[#|2010-09-14T15:06:32.688+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=com.liferay.portal.kernel.deploy.auto.AutoDeployScanner;|15:06:32,688 INFO [PortletAutoDeployListener:71] Copying portlets for /data01/home/glassfish/glassfish/liferay/deploy/transaction-viewer-portlet-1.0.0.2.war
|#]

[#|2010-09-14T15:06:32.694+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=com.liferay.portal.kernel.deploy.auto.AutoDeployScanner;| Expanding: /data01/home/glassfish/glassfish/liferay/deploy/transaction-viewer-portlet-1.0.0.2.war into /tmp/20100914150632694|#]

[#|2010-09-14T15:06:32.842+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=com.liferay.portal.kernel.deploy.auto.AutoDeployScanner;|
Copying 1 file to /tmp/20100914150632694/WEB-INF|#]

[#|2010-09-14T15:06:32.902+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=com.liferay.portal.kernel.deploy.auto.AutoDeployScanner;|
Copying 1 file to /tmp/20100914150632694/WEB-INF/classes|#]

[#|2010-09-14T15:06:32.904+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=com.liferay.portal.kernel.deploy.auto.AutoDeployScanner;|
Copying 1 file to /tmp/20100914150632694/WEB-INF/classes|#]

[#|2010-09-14T15:06:33.045+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=com.liferay.portal.kernel.deploy.auto.AutoDeployScanner;|
Building war: /tmp/20100914150633037|#]

[#|2010-09-14T15:06:33.245+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=com.liferay.portal.kernel.deploy.auto.AutoDeployScanner;|
Building war: /data01/home/glassfish/glassfish/nodeagents/s604582nj3vl31.uspswy6.savvis.net/liferay-instance2/autodeploy/transaction-viewer-portlet.war|#]

[#|2010-09-14T15:06:33.336+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=com.liferay.portal.kernel.deploy.auto.AutoDeployScanner;|
Deleting directory /tmp/20100914150632694|#]

[#|2010-09-14T15:06:33.338+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=21;_ThreadName=com.liferay.portal.kernel.deploy.auto.AutoDeployScanner;|
15:06:33,338 INFO [PortletAutoDeployListener:81] Portlets for /data01/home/glassfish/glassfish/liferay/deploy/transaction-viewer-portlet-1.0.0.2.war copied successfully. Deployment will start in a few seconds.



Thanks,
KVD
Mike Harris, módosítva 13 év-val korábban

RE: Autodeploy, glassfish, cluster

Junior Member Bejegyzések: 91 Csatlakozás dátuma: 2011.03.28. Legújabb bejegyzések
Did you find a solution? I have the same problem...
nickc nickc, módosítva 11 év-val korábban

RE: Autodeploy, glassfish, cluster

New Member Bejegyzés: 1 Csatlakozás dátuma: 2013.01.15. Legújabb bejegyzések
Hello,
I have liferay + glassfish deployed in clustered environment and autodeploy hangs with message ""copied successfully. Deployment will start in a few seconds."
Someone find a soloution?

Thanks