0

I want to make session clustering with terracotta and 2 tomcat on single server. i following instruction from :

http://artur.ejsmont.org/blog/content/how-to-setup-terracotta-session-clustering-and-replication-for-apache-tomcat-6

This is my tc-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<tc:tc-config xmlns:tc="http://www.terracotta.org/config"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-4.xsd">
 <servers>
   <server name="nodea" host="localhost">
     <data>/home/meruvian/mydatafolder</data>
     <logs>/home/meruvian/mylogsfolder</logs>
     <l2-group-port>9530</l2-group-port>
   </server>
   <server name="nodeb" host="localhost">
     <data>/home/meruvian/mydatafolder</data>
     <logs>/home/meruvian/mylogsfolder</logs>
     <l2-group-port>9530</l2-group-port>
   </server>
 </servers>
 <clients>
   <logs>/var/log/myclientlogsfolder</logs>
       <modules>
       <module name="tim-tomcat-6.0" version="2.2.0"/>
   </modules>
 </clients>
 <application>
   <dso>
     <instrumented-classes>
       <include>
         <class-expression>*..*</class-expression>
       </include>
       <exclude>org.apache.coyote..*</exclude>
       <exclude>org.apache.catalina..*</exclude>
       <exclude>org.apache.jasper..*</exclude>
       <exclude>org.apache.tomcat..*</exclude>
     </instrumented-classes>
     <web-applications>
       <web-application>sessionapp</web-application>
     </web-applications>
    </dso>
 </application>
</tc:tc-config>

Then when i try to execute command :

/start-tc-server.sh -f ~/Terracotta/terracotta-3.6.2/tc-config.xml 

But i get error message like bellow :

Fatal Terracotta startup exception:

*******************************************************************************
You have not specified a name for your Terracotta server, and there are 2 servers defined in the Terracotta configuration file. The script can not automatically choose between the following server names: nodea, nodeb. Pass the desired server name to the script using the -n flag.
*******************************************************************************

What the meaning of

<web-application>sessionapp</web-application>

Is it my contex path of my app ?

Anyone can help me to solve this, to cluster session with tomcat + terracotta ?

Thanks

troya_adromeda
  • 647
  • 4
  • 15
  • 33

1 Answers1

0

I am by no means an authority on Terracotta, but according to me, there are 2 problems here:

  1. You have specified 2 servers running on localhost, with no port specifications. Both will try to take up port 9510 (dso port) which will cause a problem. You need to specify different dso ports.
  2. Assuming you do fix the port configuration, you have both your servers running on localhost, so terracotta needs to know the server you are trying to start. Use this command to start nodea:

    /start-tc-server.sh -f ~/Terracotta/terracotta-3.6.2/tc-config.xml -n nodea
    

Similarly for nodeb. See if that helps.

Pablo Claus
  • 5,886
  • 3
  • 29
  • 38
Aditya
  • 2,148
  • 3
  • 21
  • 34