原网址:http://javadrama.blogspot.com/2012/10/terracotta-and-tomcat-clustering-page-2.html
Now, download apache-tomcat-6.0.35 and extract it twice to two directories of your choice, i will refer to them as ${CATALINA_HOME_NODE1} and ${CATALINA_HOME_NODE2}.
Copy Terracotta Libraries
we need two jar files to be copied to both Tomcats lib directory.
${TC_HOME}\common\terracotta-toolkit-1.6-runtime-5.0.0.jar
${TC_HOME}\sessions\terracotta-session-1.3.0.jar
Copy Terracotta Config File
we need to copy the same Terracotta configuration file to the conf directory of bothTomcats
${TC_HOME}\config\tc-config.xml
one small change to do, the client log location, both clients (Tomcat servers) can't be configured with the same client log location.
edit ${CATALINA_HOME_NODE2}\conf\tc-config.xml
change log location under the clients tag
<logs>%(user.home)/terracotta/client-logs</logs>
to be
<logs>%(user.home)/terracotta/client-logs2</logs>
Terracotta Valve
Tomcat connects to Terracotta by intercepting requests via a value, now let's hook that valve.
under the conf directory of both Tomcats, edit the file context.xml to look like this:
<Context> <!-- Default set of monitored resources --> <WatchedResource>WEB-INF/web.xml</WatchedResource> <!-- Uncomment this to disable session persistence across Tomcat restarts --> <Manager pathname="" /> <!-- Hook the Terracotta Valve and configure it using the tc-config.xml file --> <Valve className="org.terracotta.session.TerracottaTomcat60xSessionValve" tcConfigUrl="../conf/tc-config.xml"/> </Context>
note that we have disabled session persistence across Tomcat restarts because that is a task for Terracotta now.
Tomcat HA Configurations
jvmRoute
we need to define a unique jvmRoute for each Tomcat server.
edit ${CATALINA_HOME_NODE1}\conf\server.xml, change the Engine tag to look like this:
<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1">
edit ${CATALINA_HOME_NODE2}\conf\server.xml, change the Engine tag to look like this:
in ${CATALINA_HOME_NODE2}\conf\server.xml, i have changed
shutdown port: 8005 to 8006
http port: 8080 to 8081
ajp port: 8009 to 8010
<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat2">
Make sure you don't have port conflicts
as i am running both Tomcats on the same box, i had to change the ports for the second Tomcat.in ${CATALINA_HOME_NODE2}\conf\server.xml, i have changed
shutdown port: 8005 to 8006
http port: 8080 to 8081
ajp port: 8009 to 8010
Run both Tomcats
open two more terminals and navigate to ${CATALINA_HOME_NODE1}\bin on one and ${CATALINA_HOME_NODE2}\bin on the other, on both terminals execute:
startup.bat
if everything went as it should, you should see something like that on both Tomcat terminals
Terracotta 3.7.0, as of 20120717-133013 (Revision unknown-20453 by cruise@rh5vmo113.terracotta.lan from 3.7.0) Successfully loaded base configuration from file at 'H:\terracotta\apache-tomcat-6.0.35\bin\.\..\conf\tc-config.xml'. Successfully loaded base configuration from file at 'H:\terracotta\apache-tomcat-6.0.35\temp\tc-config8509448930662041153.xml'. Log file: 'C:\terracotta\client-logs\terracotta-client.log'. Connection successfully established to server at 127.0.0.1:9510
Test it
Tomcat comes by default with a web application called examples, we will use it till the end of this tutorial to test our setuppoint your browser to http://localhost:8080/examples/ and http://localhost:8081/examples/ and make sure both servers are responding.
open your Terracotta Development Console and make sure that both clients (the tomcat server) are present as below.
also note that the sessions button is now active.
相关推荐
terracotta-toolkit-1.3-runtime-3.2.0.jar 集群实现JAR
其实terracotta集群tomcat这方面的资料也算不少了··但还是会很容易出现错误·· 希望我这个文档能帮助大家!
2014年05月12日最新版本, Windows版本 terracotta-ee-4.1.2.jar,terracotta-license.key
terracotta-3.7.7-installer.jar
terracotta-eclipse-plugin-3.7.7-2013-08-19_16-03-48.tar(terracotta的Eclipse插件) 发现官网挺卡的,有时候下不了,先传上来吧,供国内用户下载,这个算最新的吧。2014-02-17下载的。
terracotta-3.7.7-2013-08-19_16-03-48-installer(jar安装包) 官方网站卡得要死,有时候不一定能下载,把最近自己用的,算最新版吧,提供在国内网站下载吧。 2014-02-17下载的。
Terracotta的基本原理是对于集群间共享的数据,当在一个节点发生变化的时候,Terracotta只把变化的部分发送给Terracotta服务器,然后由服务器把它转发给真正需要这个数据的节点。这样对网络的压力就非常小,各个节点...
terracotta-ee-3.5.2破解版
记载了terracotta如何与tomcat、jetty等服务器的集群,解释了tc-config.xml中各个配置的作用
本文介绍如何配置Tomcat和Terracotta服务器将普通的Web应用部署到集群中,实现跨Tomcat节点的session复制,以达到负载均衡、提高系统吞吐量和灾难恢复的效果。
Terracotta实现基于Tomcat的Web应用集群
Terracotta
jar包,官方版本,自测可用
资源分类:Python库 所属语言:Python 资源全名:terracotta-toolbelt-0.0.5.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
做ehcache分布式缓存用的! ehcache-2.6.6.jar和terracotta-toolkit-1.6-runtime-5.5.0.jar 主要是给自己写的博客中做一个下载资源链接!
terracotta完整开发插件,可以作为eclipse的插件,也可以单独使用,功能齐全;
terracotta-3.7.7.tar.gz 官方网站卡得要死,有时候不一定能下载,把最近自己用的,算最新版吧,提供在国内网站下载吧。 2014-02-17下载的。
它使用PHP编写,使用XML文件存储META信息。 结合现代想法(XSL,CSS等),它旨在成为单个管理员站点的内容管理解决方案
NULL 博文链接:https://lihongchao87.iteye.com/blog/1727802