2015-01-13 21:38 GMT+03:00 Théo Chamley <theo...@mley.fr>: > Hello, > > I have setup a Tomcat cluster and I am now trying to get the FarmWarDeployer > to work. > However, it seems that the Deployer never checks my watchDir and therefore > never finds my new wars to deploy. > > When starting Tomcat, the logs indicate that the Deployer is started: > 13-Jan-2015 19:21:43.942 INFO [Catalina-startStop-1] > org.apache.catalina.ha.deploy.FarmWarDeployer.start Cluster deployment is > watching [/my/watch/dir/] for changes. > 13-Jan-2015 19:21:43.942 INFO [Catalina-startStop-1] > org.apache.catalina.ha.deploy.FarmWarDeployer.start Cluster FarmWarDeployer > started. > > But nothing more, even for extended periods of time after putting my > ROOT.war inside my watchDir. > > I checked the source code > (https://github.com/apache/tomcat80/blob/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java), > and it seems that the check must be done once every two "backgroundProcess" > calls, but I don't understand when this function is supposed to be called or > if there is a way to force the check. > > I feel like I am missing something obvious... > > > Here is my config: > Oracle JDK 1.8.0_25 > Tomcat 8.0.15 > server.xml: > <Host name="www.exemple.com" appBase="/my/app/base" > unpackWARs="true" > autoDeploy="true" > > > <Cluster > className="org.apache.catalina.ha.tcp.SimpleTcpCluster" > channelSendOptions="6"> > <Manager > className="org.apache.catalina.ha.session.BackupManager" > expireSessionsOnShutdown="false" > notifyListenersOnReplication="true" > mapSendOptions="6"/> > <Channel > className="org.apache.catalina.tribes.group.GroupChannel"> > <Membership > className="org.apache.catalina.tribes.membership.McastService" > address="228.0.0.4" > port="45564" > frequency="500" > dropTime="3000" > bind="10.0.0.1"/> > <Receiver > className="org.apache.catalina.tribes.transport.nio.NioReceiver" > address="10.0.0.1" > port="5000" > selectorTimeout="100" > maxThreads="6"/> > <Sender > className="org.apache.catalina.tribes.transport.ReplicationTransmitter"> > <Transport > className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/> > </Sender> > <Interceptor > className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/> > <Interceptor > className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/> > <Interceptor > className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor"/> > </Channel> > <Valve > className="org.apache.catalina.ha.tcp.ReplicationValve" > > filter=".*.gif|.*.js|.*.jpeg|.*.jpg|.*.png|.*.css|.*.txt"/>
Note "." before file name extension has to be escaped to mean a literal '.' instead of "any-character" pattern, ".*\.gif" etc. > <Deployer > className="org.apache.catalina.ha.deploy.FarmWarDeployer" > tempDir="/my/temp/dir/" > deployDir="/my/app/base/" > watchDir="/my/listen/dir/" > watchEnabled="true"/> I wonder why there are two getter methods for watchEnabled property in FarmWarDeployer, [[[ public boolean isWatchEnabled() { return watchEnabled; } public boolean getWatchEnabled() { return watchEnabled; } public void setWatchEnabled(boolean watchEnabled) { this.watchEnabled = watchEnabled; } ]]] > <ClusterListener > className="org.apache.catalina.ha.session.ClusterSessionListener"/> > </Cluster> > </Host> > > The logs now show that the listen dir is checked, but nothing more, even if I > repeatedly "touch" the ROOT.war file. And > from the source code, I won't > have more information from the logs… > Could the mount options of the file system influence the result? My partition > is mounted with > rw,nosuid,nodev,noexec,noatime,nodiratime,data=ordered. > 19-Jan-2015 12:04:27.956 FINE [ContainerBackgroundProcessor[ StandardEngine[Catalina]]] org.apache.catalina.ha.deploy.WarWatcher.check check cluster wars at /my/watch/dir Note that message says "/my/watch/dir", but the configuration above uses "/my/listen/dir/". What are access permissions for the directory and for the file. Is there search permission on the directory, is the file readable? E.g. if the directory is not readable File.listFiles() returns null, but the code interprets it as an empty list, silently proceeding further. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org