Dynamic and Static Discovery cluster with Apache TomEE

Hey there!

On my last post Are there different types of clusters? we saw two different types of clusters: Dynamic Discovery and Static Discovery. To see details, see the post! 😉

Now let’s see quickly how we can set them up at the Apache TomEE. One of the types – the Dynamic – we have already seen in the post How to build an Apache TomEE cluster. So we will do just a little zoom to see where the things are done.

 

Dynamic Discovery

At the “Engine” node you should put this code (see the post mentioned above for detailed code):

<Cluster
className=”org.apache.catalina.ha.tcp.SimpleTcpCluster”
channelSendOptions=”6″>
<Manager…
<Channel…
<Valve…
<Deployer…
<ClusterListener…
</Cluster>

 

Static Discovery

At the same “Engine” node you should put this:

<Cluster className=”org.apache.catalina.ha.tcp.SimpleTcpCluster”channelSendOptions=”6″>
<Channel className=”org.apache.catalina.tribes.group.GroupChannel”>
<Interceptor className=”org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor”>
<Member className=”org.apache.catalina.tribes.membership.StaticMember” port=”4000″ host=”server1″ uniqueId=”{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}” />
<Member className=”org.apache.catalina.tribes.membership.StaticMember” port=”4000″ host=”server2″ uniqueId=”{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2}” />
<Member className=”org.apache.catalina.tribes.membership.StaticMember” port=”4000″ host=”server3″ uniqueId=”{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3}” />
</Interceptor>
</Channel>
</Cluster>

 

So as you can see, with the Static Discovery you use the StaticMember at the Member node instead of McastService used at the Dynamic Discovery. To see the functional differences between them see my last post Are there different types of clusters?.

Hope you enjoy building your own TomEE cluster! If you have any particular experience to share, please leave it at the comments bellow. See you!

Advertisements

Author: Elder Moraes

My name is Elder Moraes and I am Brazilian. I am passionate for programming languages, specially Java. I've been working on IT market since 1999 and learned a lot of stuff (and maybe some tech things). I am also a husband, father, musician and an addicted reader.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s