Js操作Select大全(取值、设置选中等等)
2016-01-12 20:01
736 查看
原网址: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}.
${TC_HOME}\common\terracotta-toolkit-1.6-runtime-5.0.0.jar
${TC_HOME}\sessions\terracotta-session-1.3.0.jar
${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
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:
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
[/code]
point 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.
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-logs2</logs>
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:
edit ${CATALINA_HOME_NODE2}\conf\server.xml, change the Engine tag to look like this:<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat2">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:
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
[code]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
[/code]
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.
相关文章推荐
- macJavascript调用动态链接库
- js初学笔记第一课
- 网页抓取jsoup
- js-实现集合的操作
- ------javascript------N
- js打印---我传给肖方username和userpassword,他在后端处理完成,返回给我。
- 启动jetty后,访问jsp页面报500错: JSP support not configured
- JS中的toFixed()四舍五入方法
- PhantomJS实现最简单的模拟登录方案
- JS函数调用的四种方法
- JS函数集合大全
- ajax处理返回的json格式数据
- JSONArray遍历
- javascript类对象和继承
- jackson json开发过程遇到的一些问题小节
- 学习JavaScript设计模式之代理模式
- 基于JavaScript实现TAB标签效果
- extjs radio样例集合
- JavaScript学习(1):基本语法
- 基于JavaScript实现瀑布流布局