【问题标题】:Session Clustering Tomcat + terracotta on single server单个服务器上的会话集群 Tomcat + terracotta
【发布时间】:2012-07-03 04:26:52
【问题描述】:

我想在单个服务器上使用 terracotta 和 2 个 tomcat 进行会话集群。 我遵循以下指示:

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

这是我的 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>

然后当我尝试执行命令时:

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

但我收到如下错误消息:

致命兵马俑启动异常:

*******************************************************************************
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.
*******************************************************************************

什么意思

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

这是我的应用程序的上下文路径吗?

谁能帮我解决这个问题,用tomcat + terracotta集群会话?

谢谢

【问题讨论】:

    标签: session tomcat terracotta


    【解决方案1】:

    我绝不是兵马俑的权威,但据我所知, 这里有两个问题:

    1. 您指定了 2 个在 localhost 上运行的服务器,没有指定端口。两者都会尝试占用端口 9510(dso 端口),这将导致问题。您需要指定不同的 dso 端口。
    2. 假设您确实修复了端口配置,您的两个服务器都在 localhost 上运行,因此 terracotta 需要知道您尝试启动的服务器。 使用此命令启动 nodea:

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

    同样适用于 nodeb。 看看有没有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-12-12
      • 2013-12-14
      • 1970-01-01
      • 2018-06-25
      • 1970-01-01
      • 1970-01-01
      • 2019-11-20
      相关资源
      最近更新 更多