Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Tomcat Clustering Configuration

$
0
0

I'm configuring Liferay on Tomcat 7 for clustering. I searched on the web and found several instructions. Reading all of them raised some questions to me. I would appreciate it if someone help me.

A. I know that by inserting the following line in server.xml in "${CATALINA_HOME}/conf", it configures Tomcat with default values as described in Tomcat Documentation (link):

<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>

Here are some of the important default values:

1- Multicast address is 228.0.0.4
2- Multicast port is 45564 (the port and the address together determine cluster membership.
3- The IP broadcasted is java.net.InetAddress.getLocalHost().getHostAddress() (make sure you don't broadcast 127.0.0.1, this is a common error)
4- The TCP port listening for replication messages is the first available server socket in range 4000-4100
5- Two listeners are configured ClusterSessionListener
6- Two interceptors are configured TcpFailureDetector and MessageDispatch15Interceptor

Since my cluster environment is small (two Tomcat instances), I think the default configurations would be good enough.

Q#A. I would like to know what exactly item #3 means. How may I make that mistake?

B. Based on the above the default configuration uses Dynamic clustering on IP address 228.0.0.4. I assume this is a broadcasting address (correct me if I'm wrong). If so, this link says:

In Linux Environment most of the system kernel is capable to process the multicast address. but we need to add route entry in kernel routing table.

sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

Q#B. What does this means? How can I know whether I should this or not?

C. As the next step for clustering, I need to add "<distributable/>" element to my web.xml file of the web application. There one web.xml for each web application in "${CATALINA_HOME}/webapps" folder on the server. I understand that all of them should have this element to included in the session replication (correct me if I'm wrong).

Q#C1. I found another "web.xml" file with "liferay-" as prefix for every web application. Should they be considered as another web.xml and have this element?

Q#C2. Is there any way to add "<distributable/>" element in one place and have it applied on all web applications? Some sort of parent/global "web.xml" file?

D. Some instructions says that "distributable='true'" attribute should be added to "<Context>" element in "${CATALINA_HOME}/conf/context.xml" file. And some don't instruct it.

Q#D. Is this configuration mandatory? What is the consequence of having this attribute and not having it?

Thanks in advance.


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>