You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Hans-Joachim Kliemeck <Ha...@hays.de> on 2016/05/19 08:55:54 UTC

tomcat cluster questions

Hey,

currently i'm building up a tomcat cluster and after studying the documentation/source some questions came up:

Is it really necessary to add a LocalMember xml element to the StaticMembershipInterceptor? I found a lot examples where this element was not added. FYI: we are using TCP and no Multicast.

Why there are 3 points to configure a heartbeat? I don't see any reason for these three points, especially for TCP:
heartbeat at channel object
heartbeat at cluster object
heartbeat at TcpPingInterceptor

Kind Regards
Hajo

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


Re: tomcat cluster questions

Posted by Keiichi Fujino <kf...@apache.org>.
Hi,

2016-05-23 18:56 GMT+09:00 Hans-Joachim Kliemeck <
Hans-Joachim.Kliemeck@hays.de>:

> Hey,
>
> > If you do not set the LocalMember,
> > the implementation class of local members will become MemberImpl rather
> than the StaticMember.
> > In addition, you can not explicitly specify the domain and the uniqueId
> of local member.
> > If you do not mind these, there is no problem if you do not set
> LocalMember.
>
> According to the configuration example, it is possible to set the
> uniqueid/domain. Could you clarify your statement?
> https://tomcat.apache.org/tomcat-7.0-doc/config/cluster-interceptor.html
>
>      <Interceptor
> className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor">
>        <LocalMember
> className="org.apache.catalina.tribes.membership.StaticMember"
>                   port="4000"
>                   securePort="-1"
>                   host="tomcat01.mydomain.com"
>                   domain="staging-cluster"
>                   uniqueId="{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1}"/>
>        <Member
> className="org.apache.catalina.tribes.membership.StaticMember"
>                   port="5678"
>                   securePort="-1"
>                   host="tomcat01.mydomain.com"
>                   domain="staging-cluster"
>                   uniqueId="{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}"/>
>      </Interceptor>
>
>
>
If you explicitly define the <LocalMember> in server.xml,
You can define the domain and uniqueId. (As in the above example)
If you do not define a <LocalMember> in server.xml,
the local member is automatically generated by the multicast service.
(This multicast service is available even if you use a static cluster)
The domain of this local member is used the domain  that is defined by
multicast service.
The uniqueId is automatically generated in multicast service.




> > The heartbeat is chained.
> >
> Container->Cluster->channel->Interceptor(TcpPingInterceptor)->ChannelSender
> > When using a static membership, TcpPingInterceptor does the nodes
> failure detection.
> > Therefore, when using a static membership, TcpPingInterceptor is
> required.
> I understand the concept of this chain, but I want to understand WHY there
> are these 3 points to enable the heartbeat instead of a central one?
> I don’t see a reason to send the heartbeat on different levels of the
> chain.
>
>
Usually, The heartbeat is controlled by the Channel#heartbeat only.
If you want to do the heartbeat, you set true to Channel#heartbeat.
If you do not want to do the heartbeat, you set false to Channel#heartbeat.
Cluster#heartbeatBackgroundEnabled is set to true only if you want to do a
heartbeat by the container background thread
.
The default is false
If heartbeatBackgroundEnabled is true, Channel # heartbeat is forced to
false.
The useThread is set to true only if you want to send a PING in a different
period than the heartbeat of the channel.



> Regards
> Hajo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> --
> Keiichi.Fujino
> <us...@tomcat.apache.org>
> <us...@tomcat.apache.org>
>

AW: tomcat cluster questions

Posted by Hans-Joachim Kliemeck <Ha...@hays.de>.
Hey,

> If you do not set the LocalMember,
> the implementation class of local members will become MemberImpl rather than the StaticMember.
> In addition, you can not explicitly specify the domain and the uniqueId of local member.
> If you do not mind these, there is no problem if you do not set LocalMember.

According to the configuration example, it is possible to set the uniqueid/domain. Could you clarify your statement?
https://tomcat.apache.org/tomcat-7.0-doc/config/cluster-interceptor.html

     <Interceptor className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor">
       <LocalMember className="org.apache.catalina.tribes.membership.StaticMember"
                  port="4000"
                  securePort="-1"
                  host="tomcat01.mydomain.com"
                  domain="staging-cluster"
                  uniqueId="{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1}"/>
       <Member className="org.apache.catalina.tribes.membership.StaticMember"
                  port="5678"
                  securePort="-1"
                  host="tomcat01.mydomain.com"
                  domain="staging-cluster"
                  uniqueId="{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}"/>
     </Interceptor>


> The heartbeat is chained.
> Container->Cluster->channel->Interceptor(TcpPingInterceptor)->ChannelSender
> When using a static membership, TcpPingInterceptor does the nodes failure detection.
> Therefore, when using a static membership, TcpPingInterceptor is required.
I understand the concept of this chain, but I want to understand WHY there are these 3 points to enable the heartbeat instead of a central one?
I don’t see a reason to send the heartbeat on different levels of the chain.

Regards
Hajo

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


Re: tomcat cluster questions

Posted by Keiichi Fujino <kf...@apache.org>.
2016-05-19 17:55 GMT+09:00 Hans-Joachim Kliemeck <
Hans-Joachim.Kliemeck@hays.de>:

> Hey,
>
> currently i'm building up a tomcat cluster and after studying the
> documentation/source some questions came up:
>
> Is it really necessary to add a LocalMember xml element to the
> StaticMembershipInterceptor?


If you do not set the LocalMember,
the implementation class of local members will become MemberImpl rather
than the StaticMember.
In addition, you can not explicitly specify the domain and the uniqueId of
local member.
If you do not mind these, there is no problem if you do not set LocalMember.



> I found a lot examples where this element was not added. FYI: we are using
> TCP and no Multicast.
>
>
This setting was introduced in r1714919,
it does not exist this setting in the examples that have been published
earlier.


> Why there are 3 points to configure a heartbeat? I don't see any reason
> for these three points, especially for TCP:
> heartbeat at channel object
> heartbeat at cluster object
> heartbeat at TcpPingInterceptor
>
>
The heartbeat is chained.
Container->Cluster->channel->Interceptor(TcpPingInterceptor)->ChannelSender
When using a static membership, TcpPingInterceptor does the nodes failure
detection.
Therefore, when using a static membership, TcpPingInterceptor is required.



> Kind Regards
> Hajo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> --
> Keiichi.Fujino
> <us...@tomcat.apache.org>

<us...@tomcat.apache.org>