You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2024/02/12 15:21:49 UTC

Re: [OT] Tomcat not syncing existing sessions on restart

Mark,

On 2/9/24 06:14, Mark Thomas wrote:
> With the Receiver using address="0.0.0.0" I see the same issues you do. 
> I'm not yet convinced that is a bug.

If this is known to essentially always not-work... should we log 
something at startup? I wouldn't refuse to configure, since anyone using 
0.0.0.0 with /separate/ hosts wouldn't experience this problem.

-chris

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


Re: [OT] Tomcat not syncing existing sessions on restart

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
I would suggest focusing on Docker networking rather than Tomcat. My 
guess is that how that works will inform your Tomcat configuration. You 
might also try first getting it to work with two Docker instances on a 
single machine.

-Terence Bandoian

On 3/1/2024 11:59 AM, Manak Bisht wrote:
> I am fairly certain now that the docker container is the problem. I am
> unable to replicate the issue without it. Using the hostname/IP address of
> the host (tomcat/ip) for the receiver always causes the following problem,
> 01-Mar-2024 22:30:32.315 INFO [main]
> org.apache.catalina.tribes.transport.ReceiverBase.bind Unable to bind
> server socket to:tomcat/ip:4000 throwing error.
> 01-Mar-2024 22:30:32.315 SEVERE [main]
> org.apache.catalina.tribes.transport.nio.NioReceiver.start Unable to start
> cluster receiver
>   java.net.BindException: Cannot assign requested address
> at sun.nio.ch.Net.bind0(Native Method)
> at sun.nio.ch.Net.bind(Net.java:433)
> at sun.nio.ch.Net.bind(Net.java:425)
> at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
> at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
> at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67)
> at
> org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:184)
> at
> org.apache.catalina.tribes.transport.nio.NioReceiver.bind(NioReceiver.java:125)
> at
> org.apache.catalina.tribes.transport.nio.NioReceiver.start(NioReceiver.java:89)
> at
> org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:150)
> at
> org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator.java:102)
> at
> org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:155)
> at
> org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:155)
> at
> org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor.start(StaticMembershipInterceptor.java:108)
> at
> org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:155)
> at
> org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:155)
> at
> org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor.start(TcpPingInterceptor.java:65)
> at
> org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:155)
> at
> org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:421)
> at
> org.apache.catalina.ha.tcp.SimpleTcpCluster.startInternal(SimpleTcpCluster.java:544)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at
> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:902)
> at
> org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at
> org.apache.catalina.core.StandardService.startInternal(StandardService.java:439)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at
> org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:760)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:625)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
>
> Either address binding does not work for any address inside the container
> or just binding to the address of the host machine does not work. I am
> leaning towards the latter because the *<Member> *element has never
> exhibited this issue. Here's what I have already tried/checked,
>
>     - The receiver/address port of the container is mapped to the same port
>     on the host
>     - The IP of the host is reachable via ping and telnet from the container.
>     - Running the following code from inside the container always works
>     java.net.InetAddress bind = java.net.InetAddress.getByName("tomcat");
>     System.out.println(bind); // Output: tomcat/ip
>
> I have read a lot of resources and tried a variety of solutions to no
> avail. Literature covering session replication with containerisation is
> also sparse. If someone has tried this before or has any ideas, please let
> me know, I would greatly appreciate it.
>
> Sincerely,
> Manak Bisht
>
>
> On Mon, Feb 12, 2024 at 9:07 PM Christopher Schultz <
> chris@christopherschultz.net> wrote:
>
>> Manak,
>>
>> On 2/12/24 10:33, Manak Bisht wrote:
>>> Chris,
>>>
>>> On Mon, 12 Feb 2024, 20:52 Christopher Schultz, <
>>> chris@christopherschultz.net> wrote:
>>>
>>>> I wouldn't refuse to configure, since anyone using
>>>> 0.0.0.0 with /separate/ hosts wouldn't experience this problem.
>>>
>>> I am using separate hosts (two docker containers on two different
>> machines)
>>> in my main deployment. I just reproduced the problem on the same host to
>>> rule out network issues.
>> Thanks for the clarification. For some reason, I thought this was two
>> Docker containers on the same host.
>>
>> -chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail:users-help@tomcat.apache.org
>>
>>


Re: [OT] Tomcat not syncing existing sessions on restart

Posted by Manak Bisht <ma...@iiitd.ac.in>.
I am fairly certain now that the docker container is the problem. I am
unable to replicate the issue without it. Using the hostname/IP address of
the host (tomcat/ip) for the receiver always causes the following problem,
01-Mar-2024 22:30:32.315 INFO [main]
org.apache.catalina.tribes.transport.ReceiverBase.bind Unable to bind
server socket to:tomcat/ip:4000 throwing error.
01-Mar-2024 22:30:32.315 SEVERE [main]
org.apache.catalina.tribes.transport.nio.NioReceiver.start Unable to start
cluster receiver
 java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67)
at
org.apache.catalina.tribes.transport.ReceiverBase.bind(ReceiverBase.java:184)
at
org.apache.catalina.tribes.transport.nio.NioReceiver.bind(NioReceiver.java:125)
at
org.apache.catalina.tribes.transport.nio.NioReceiver.start(NioReceiver.java:89)
at
org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:150)
at
org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator.java:102)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:155)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:155)
at
org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor.start(StaticMembershipInterceptor.java:108)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:155)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:155)
at
org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor.start(TcpPingInterceptor.java:65)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:155)
at
org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:421)
at
org.apache.catalina.ha.tcp.SimpleTcpCluster.startInternal(SimpleTcpCluster.java:544)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:902)
at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:439)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:760)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

Either address binding does not work for any address inside the container
or just binding to the address of the host machine does not work. I am
leaning towards the latter because the *<Member> *element has never
exhibited this issue. Here's what I have already tried/checked,

   - The receiver/address port of the container is mapped to the same port
   on the host
   - The IP of the host is reachable via ping and telnet from the container.
   - Running the following code from inside the container always works
   java.net.InetAddress bind = java.net.InetAddress.getByName("tomcat");
   System.out.println(bind); // Output: tomcat/ip

I have read a lot of resources and tried a variety of solutions to no
avail. Literature covering session replication with containerisation is
also sparse. If someone has tried this before or has any ideas, please let
me know, I would greatly appreciate it.

Sincerely,
Manak Bisht


On Mon, Feb 12, 2024 at 9:07 PM Christopher Schultz <
chris@christopherschultz.net> wrote:

> Manak,
>
> On 2/12/24 10:33, Manak Bisht wrote:
> > Chris,
> >
> > On Mon, 12 Feb 2024, 20:52 Christopher Schultz, <
> > chris@christopherschultz.net> wrote:
> >
> >> I wouldn't refuse to configure, since anyone using
> >> 0.0.0.0 with /separate/ hosts wouldn't experience this problem.
> >
> >
> > I am using separate hosts (two docker containers on two different
> machines)
> > in my main deployment. I just reproduced the problem on the same host to
> > rule out network issues.
>
> Thanks for the clarification. For some reason, I thought this was two
> Docker containers on the same host.
>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: [OT] Tomcat not syncing existing sessions on restart

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Manak,

On 2/12/24 10:33, Manak Bisht wrote:
> Chris,
> 
> On Mon, 12 Feb 2024, 20:52 Christopher Schultz, <
> chris@christopherschultz.net> wrote:
> 
>> I wouldn't refuse to configure, since anyone using
>> 0.0.0.0 with /separate/ hosts wouldn't experience this problem.
> 
> 
> I am using separate hosts (two docker containers on two different machines)
> in my main deployment. I just reproduced the problem on the same host to
> rule out network issues.

Thanks for the clarification. For some reason, I thought this was two 
Docker containers on the same host.

-chris

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


Re: [OT] Tomcat not syncing existing sessions on restart

Posted by Manak Bisht <ma...@iiitd.ac.in>.
Chris,

On Mon, 12 Feb 2024, 20:52 Christopher Schultz, <
chris@christopherschultz.net> wrote:

> I wouldn't refuse to configure, since anyone using
> 0.0.0.0 with /separate/ hosts wouldn't experience this problem.


I am using separate hosts (two docker containers on two different machines)
in my main deployment. I just reproduced the problem on the same host to
rule out network issues.

Sincerely,
Manak Bisht