I have setup apache-tomcat clustering(Ubuntu Server) and I used tomcat supported clustering technique with mod\_jk following the [link](http://www.vicconsult.com/tips/apache-tomcat-load-balance-session-replication.html). I've setup with One Load Balancer and Two web servers.

The major problem is deploying the WAR file and to which web server?. I got to know about Farmed Deployment which deploys war file to other tomcat servers in the cluster but I haven't got it working yet. I used the farm deployer in the below fashion in the element on two of the web servers.

Web Server 1(192.168.1.101)

```
<Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
                    tempDir="/usr/share/tomcat/temp/"
                    deployDir="/usr/share/tomcat/webapps/"
                    watchDir="/usr/share/tomcat/watch/"
                    watchEnabled="true"/>

```

Web Server 2(192.168.1.102)

```
<Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
                    tempDir="/usr/share/tomcat/temp/"
                    deployDir="/usr/share/tomcat/webapps/"
                    watchDir="/usr/share/tomcat/webapps/"
                    watchEnabled="false"/>

```

I placed the WAR in watch directory on web server 1 but it's not deploying to other server. Anybody got this working, Any thing I'm doing wrong?, please let me know!.

Thank you!

**Update:1**

I could see the following info in either of the machines in catalina.out logs,

```
14 Aug, 2011 9:12:11 PM org.apache.catalina.ha.deploy.FarmWarDeployer start
SEVERE: FarmWarDeployer can only work as host cluster subelement!

```

It don't even deploy to webserver1 and also not to webserver2. Getting 404 error when accessed the site. Any more help...?. One more thing, I didn't install tomcat from apt repository but I built it from source which is working perfectly for the our java apps.