tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Is FarmWarDeployer is working?
Date Fri, 06 Aug 2010 14:44:21 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Shammi,

On 8/6/2010 5:28 AM, shammi@arosys.com wrote:
> I have created two instances of tomcat7 in the same machine. First
> time I am using FarmWarDeployer. I only knows that using this we can 
> deploy our application in one node in the tomcat cluster rather than 
> deploying in all the nodes.

Unfortunately, there isn't much documentation on the FarmWarDeployer.
Here's what I've been able to find:

http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html

...which gives a configuration example:

          <Deployer
className="org.apache.catalina.ha.deploy.FarmWarDeployer"
                    tempDir="/tmp/war-temp/"
                    deployDir="/tmp/war-deploy/"
                    watchDir="/tmp/war-listen/"
                    watchEnabled="false"/>

It also says:

"
The default tomcat cluster supports farmed deployment, ie, the cluster
can deploy and undeploy applications on the other nodes. The state of
this component is currently in flux but will be addressed soon. There
was a change in the deployment algorithm between Tomcat 5.0 and 5.5 and
at that point, the logic of this component changed to where the deploy
dir has to match the webapps directory.
For more info, Please visit the reference documentation
"

I suspect the phrase "the cluster" in the first sentence really means
"one particular node in the cluster".

The "reference documentation" mention at the end is currently blank :(

There is also, of course, the javadoc:

http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/ha/deploy/FarmWarDeployer.html

The documentation seems all messed-up: The javadoc says "deployDir - the
directory where we watch for changes" and "applicationDir - the
directory where we install applications" but it's clear that the former
is where the apps are installed, the latter is fictional, and the real
"watch directory" is called "watchDir".

> Then after some reading what I did is :
> I created /tmp/war-deploy , /tmp/war-app , /tmp/war-listen and /war-temp
> directories.

Good. What is /tmp/war-app for? What does your <Deployer> element look
like? I suspect something like this:

          <Deployer
className="org.apache.catalina.ha.deploy.FarmWarDeployer"
                    tempDir="/tmp/war-temp/"
                    deployDir="/tmp/war-deploy/"
                    watchDir="/tmp/war-listen/"
                    watchEnabled="false"/>

> I started the tomcat. Here is the portion of the catalina.out file.
> 
> 6 Aug, 2010 12:46:37 PM org.apache.catalina.ha.deploy.FarmWarDeployer start
> INFO: Cluster deployment is watching /tmp/war-listen/ for changes.
> 6 Aug, 2010 12:46:37 PM org.apache.catalina.ha.deploy.FarmWarDeployer start
> INFO: Cluster FarmWarDeployer started.
> I understood that FarmWarDeployer started to work.

Looks good.

> Now the following message is in the catalina.out in every 20 sec.
> 
> INFO: check cluster wars at /tmp/war-listen
> 6 Aug, 2010 12:53:23 PM org.apache.catalina.ha.deploy.WarWatcher check

Sounds like it's polling that directory, which would appear to be normal
operation (though that IMO should probably be a DEBUG message, and not
INFO).

> Now when I copy my webapplication in the /war-deploy , /tmp/war-app , then
> there is no changes in the catalina.out log file.

Don't do that: the only place you should put your file is in
/tmp/war-listen.

> But when I copy my
> application in /tmp/war-listen/ directory following message appears in the
> log file :
> 
> 6 Aug, 2010 1:01:56 PM org.apache.catalina.ha.deploy.WarWatcher check
> INFO: check cluster wars at /tmp/war-listen
> 6 Aug, 2010 1:01:56 PM org.apache.catalina.ha.deploy.FarmWarDeployer
> fileModified
> INFO: Installing webapp[/sessionReplication2] from
> /tmp/war-deploy/sessionReplication2.war
> 6 Aug, 2010 1:01:56 PM org.apache.catalina.ha.deploy.FarmWarDeployer remove
> INFO: Cluster wide remove of web app /sessionReplication2

This is probably because it's undeploying the webapp you deployed
improperly by copying it into the /tmp/war-deploy directory.

> 6 Aug, 2010 1:02:16 PM org.apache.catalina.ha.deploy.WarWatcher check
> INFO: check cluster wars at /tmp/war-listen

Try stopping all instances of Tomcat, removing all files from
/tmp/war-*, deleting all of Tomcat's "work" directories, and then
starting all Tomcat instances.

Then, copy your WAR file into /tmp/war-listen and see what happens.

It's unclear to me whether the configuration on all of the nodes in the
cluster should be the same. For instance, if you have two Tomcat
instances on the same server with watchDir=/tmp/war-listen, then both
instances will be watching the same directory and trying to deploy to
the cluster. They are likely to interfere with each other.

Consider using /tmp/war-listen_1 and /tmp/war_listen_2, and
/tmp/war-deploy_1 and /tmp/war_deploy_2, etc.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxcH8UACgkQ9CaO5/Lv0PCJXQCePplQfy3bdJy5uhJ7PzKPcdOa
6ZIAoL4NE5NvJM4FG+4Hl46RN5LbX1yE
=KfyE
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message