Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fix formatting.

How to use

...

Tomcat clustering in the cloud.

The load-balancer and the sticky (or not sticky) logic is provided by the cloud it selfitself, basically you have to expose a service and configure a route. Cloud configuration depends on the cloud providers, document documentation for the mean more cloud providers will be added to this wiki.

The tomcat Tomcat clustering for the cloud uses Kubernetes, so you have to configure your nodes to use Kubernetes, all cloud providers support Kubernetes. Kubernetes uses Docker so you have to create a Docker image to use tomcat Tomcat in the cloud. There are 2 ways to organize your images, : use a standalone tomcat Tomcat and add your webapps to it or prepare your webapps as a micro service and have one image per webappswebapp. Each image will be started as a pod on kubernetesKubernetes, you can scale up and down by changing the number of pods running your webapp or your tomcatTomcat. Hanging or dying pods are restarted by kubernetesKubernetes.

1 - "Full" tomcat configuration:

In server.xml use the following:

Code Block
languagexml
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster">

...


<Channel className="org.apache.catalina.tribes.group.GroupChannel">

...


<Membership className="org.apache.catalina.tribes.membership.cloud.CloudMembershipService"/>

...


</Channel>

...


</Cluster>


2 - Example:

There there is an example to use it with OpenShift in https://github.com/jfclere/tomcat-kubernetes