-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Musomi,

> Musomi,
> 
> On 8/6/19 11:04, Musomi Motilewa wrote:
>> Hi-
> 
>> I'm currently running a two node cluster of Tomcat servers. I'm 
>> trying to implment Farm War Deployer 
>> (org.apache.catalina.ha.deploy.FarmWarDeployer) to deploy my war 
>> files to the cluster. The deployer is successfully deploying
>> wars on the primary node when placed in the watch directory. On
>> the secondary node the war file makes it to the tmp directory but
>> is not deployed. The secondary node returns the following error:
> 
>> 06-Aug-2019 09:56:31.082 SEVERE 
>> [Tribes-Task-Receiver[localhost-Channel]-3] 
>> org.apache.catalina.ha.deploy.FarmWarDeployer.messageReceived 
>> Failed to rename [/var/tmp/war-tmp/ServerHealth.war] to 
>> [/opt/tomcat/latest/webapps/ServerHealth.war]
> 
>> Server Configuration
> 
>> - Apache Tomcat/9.0.22, - openjdk 12.0.2 2019-07-16 OpenJDK
>> Runtime Environment 19.3 (build 12.0.2+9) OpenJDK 64-Bit Server
>> VM 19.3 (build 12.0.2+9, mixed mode, sharing)
> 
>> The <Cluster> tag is placed in the <Host> tag on both machines.
>> The deployer tag is setup as follows with watchEnabled set to
>> true on the primary server and false on the secondary. "{{ 
>> tomcat_McastAddress }}" is replaced by Ansible.
> 
>> <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
>>  channelSendOptions="8">
> 
>> <Manager className="org.apache.catalina.ha.session.DeltaManager"
>>  expireSessionsOnShutdown="false" 
>> notifyListenersOnReplication="true"/>
> 
>> <Channel 
>> className="org.apache.catalina.tribes.group.GroupChannel"> 
>> <Membership 
>> className="org.apache.catalina.tribes.membership.McastService" 
>> address="{{ tomcat_McastAddress }}" port="45564" frequency="500"
>>  dropTime="3000"/>
> 
>> <Receiver 
>> className="org.apache.catalina.tribes.transport.nio.NioReceiver"
>>  address="auto" port="4000" autoBind="100" selectorTimeout="5000"
>>  maxThreads="6"/>
> 
>> <Sender 
>> className="org.apache.catalina.tribes.transport.ReplicationTransmitte
r
>
>> 
">
> 
> 
> <Transport 
> className="org.apache.catalina.tribes.transport.nio.PooledParallelSend
er
>
> 
"/>
>> </Sender>
> 
>> <Interceptor 
>> className="org.apache.catalina.tribes.group.interceptors.TcpFailureDe
t
>
>> 
ector"/>
> 
> 
> <Interceptor 
> className="org.apache.catalina.tribes.group.interceptors.MessageDispat
ch
>
> 
Interceptor"/>
>> </Channel>
> 
>> <Valve className="org.apache.catalina.ha.tcp.ReplicationValve" 
>> filter=".*\.gif|.*\.js|.*\.jpg|.*\.jpeg|.*\.png|.*\.htm|.*\.html|.*\.
c
>
>> 
ss|.*\.txt"/>
> 
>> <Valve 
>> className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
> 
>> <Deployer
>> className="org.apache.catalina.ha.deploy.FarmWarDeployer" 
>> tempDir="/var/tmp/war-tmp/" 
>> deployDir="/opt/tomcat/latest/webapps/" 
>> watchDir="/var/tmp/war-watch/" watchEnabled="{{ 
>> tomcat_deployerWatchEnabled|default('false', true) }}" 
>> processDeployFrequency="2" />
> 
>> <ClusterListener 
>> className="org.apache.catalina.ha.session.ClusterSessionListener"/>
>
>> 
> 
> </Cluster>
> 
>> The tempDir, deployDir and watchDir have the following owner and 
>> group permissions set.
> 
>> /var/tmp/ drwxrwxr-x. 2 tomcat tomcat 30 Aug  6 09:56 war-tmp 
>> drwxrwxr-x. 2 tomcat tomcat  6 Aug  6 08:18 war-watch
> 
>> /opt/tomcat/lastest/ drwxr-x---. 7 tomcat tomcat    81 Aug  6
>> 09:45 webapps
> 
>> A checksum of the war file on both servers match so the file is 
>> being transfered to the secondary server's tempDir correctly. It 
>> just doesnt seem to be getting transered from the tempdir to the 
>> deployDir successfully.
> 
>> Any help in this matter would be greatly appreciated. Thanks.
> 
> What do you get when you run these commands on the "secondary
> node"?
> 
> $ id tomcat
> 
> $ ps aux | grep catalina.base
> 
> $ mount
> 
> My guess is that your server is running as "tomcat" and your file 
> permissions are correct. I'm guessing that /var/tmp and
> /opt/tomcat are on different filesystems and that File.rename
> doesn't work across filesystems in your environment.

Confirmed on Linux with ext4 and tmpfs, Java 1.8 File.renameTo will
return false and perform no action across those two filesystems.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl1J2bQACgkQHPApP6U8
pFjcAw/8DdF1bIoPgEaf3wgP9HEbHLhRA6pHEcW5tQZA/RIE/dwmCGTq/6hLu7Q/
brbyEWz0df1RCngCW/Wdls/39E2BOuQAliLiYj3OdApCG4UuUKe6K90PofSxHCte
YhQcejq17jEtA9K359QV0bVfIhX3Kksziv1A7ymRC4YFd8NbZSruHbv1TmKQU9ws
IYZKxCGqoiqVymDN2EjRyOe/XeDo5RSxZixMBEhAlx8vg33Je/GFQy9xlR1Y3G0O
SEfFrGOM3jhUVePL+4kyEMaN/COTLqUjyTQn+mcA+jbTJfm7wWJlc3XqaxWT2tUr
AzuIqSLDz6SOwGKWotZB9yzlVLLreNA2GHcWcpb1aC5p79XtaZ2jhOX6tkZcNZmg
QZr4MEQVKM02A4Ls9zPCPVzygIbfpaaIhkaetM7E7oc5q4uCy8Cmso4stgAJ4Uc6
i964Dnn77Shn5p7H0AETWWJGgNG+S0FxP3gzaN4kxKevtzDjWCFmt5g6P39E/QyM
UQwvjKIUpLJs1tx+0ZhamCRfZy0N9KHypR8WbQUKZvQ3hUVOv9StvYJ0R5PENcjO
kqJtAWUAaDBV/Na4VhGTun/haDUcJ6p78+FRVr0gTiv3OGgYHSiJFxS04OWYzp+r
AwmMTGIDBt934B1osyMhvnrzET6pJsQigqTl48YnRz2D/b3Xkzs=
=4t+l
-----END PGP SIGNATURE-----

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

Reply via email to