- 浏览: 1046357 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (538)
- 奇文共赏 (36)
- spring (13)
- hibernate (10)
- AOP/Aspectj (9)
- spring security (7)
- lucence (5)
- compass (3)
- jbmp (2)
- jboss rule(drools) (0)
- birt (1)
- jasper (1)
- cxf (3)
- flex (98)
- webgis (6)
- 设计模式 (1)
- 代码重构 (2)
- log4j (1)
- tomcat (9)
- 神品音乐 (1)
- 工作计划 (2)
- appfuse (1)
- svn (4)
- 寻章摘句 (3)
- eclipse (10)
- arcgis api for flex (1)
- 算法 (5)
- opengis-cs (1)
- bug心得 (13)
- 图标 (1)
- software&key (14)
- java (17)
- 搞笑视频 (13)
- sqlserver (9)
- postgresql (1)
- postgis (0)
- geoserver (5)
- 日子 (50)
- 水晶报表 (1)
- 绝对电影 (3)
- Alternativa3D (1)
- 酷站大全 (10)
- c++ (5)
- oracle (17)
- oracle spatial (25)
- flashbuilder4 (3)
- TweenLite (1)
- DailyBuild (6)
- 华山论贱 (5)
- 系统性能 (5)
- 经典古文 (6)
- SOA/SCA/OSGI (6)
- jira (2)
- Hadoop生态圈(hadoop/hbase/pig/hive/zookeeper) (37)
- 风水 (1)
- linux操作基础 (17)
- 经济 (4)
- 茶 (3)
- JUnit (1)
- C# dotNet (1)
- netbeans (1)
- Java2D (1)
- QT4 (1)
- google Test/Mock/AutoTest (3)
- maven (1)
- 3d/OSG (1)
- Eclipse RCP (3)
- CUDA (1)
- Access control (0)
- http://linux.chinaunix.net/techdoc/beginner/2008/01/29/977725.shtml (1)
- redis (1)
最新评论
-
dove19900520:
朋友,你确定你的标题跟文章内容对应???
tomcat控制浏览器不缓存 -
wussrc:
我只想说牛逼,就我接触过的那点云计算的东西,仔细想想还真是这么 ...
别样解释云计算,太TM天才跨界了 -
hw_imxy:
endpoint="/Hello/messagebr ...
flex+java代码分两个工程 -
gaohejie:
rsrsdgrfdh坎坎坷坷
Flex 与 Spring 集成 -
李涤尘:
谢谢。不过说得有点太罗嗦了。
Oracle数据库数据的导入及导出(转)
http://c-j.iteye.com/blog/364503
1、下载和安装。
下载安装apache2.2.3,tomcat6.0.(注意设置环境变量)
2、配置Apache
修改Apache安装目录下conf/httpd.conf文件.
由
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
修改为:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
填加以下内容(注意此配置是在1台PC开多TOMCAT进程,并注意注释的格式):
# ProxyRequests Off
#
ProxyPass / balancer://tomcatcluster/ lbmethod=byrequests stickysession=JSESSIONID nofailover=Off timeout=3 maxattempts=3
###################################################################
#
# IBmethod:
# Balancer load-balance method. Select the load-balancing scheduler method to use. Either byrequests, to perform weighted request counting or bytraffic, to perform weighted traffic byte #count balancing. Default is byrequests.
#
# stickysession:
# Balancer sticky session name. The value is usually set to something like JSESSIONID or #PHPSESSIONID, and it depends on the backend application server that # support sessions.
#
# nofailover:
# If set to On the session will break if the worker is in error state or disabled. Set this value #to On if backend servers do not support session
# replication.
#
# timeout:
# Balancer timeout in seconds. If set this will be the maximum time to wait for a free worker. #Default is not to wait.
#
# maxattempts:
# Maximum number of failover attempts before giving up.
####################################################################################
ProxyPassReverse / balancer://tomcatcluster/
<Proxy balancer://tomcatcluster>
BalancerMember ajp://localhost:8109 smax=10 route=jvm1
BalancerMember ajp://localhost:8209 smax=10 route=jvm2
BalancerMember ajp://localhost:8309 smax=10 route=jvm3
BalancerMember ajp://localhost:8409 smax=10 route=jvm4
BalancerMember ajp://localhost:8509 smax=10 route=jvm5
</Proxy>
# smax:
# Upto the Soft Maximum number of connections will be created on demand. Any connections above smax are subject to a time to live or ttl.
# route:
# Route of the worker when used inside load balancer. The route is a value appended to seesion id.
注意端口号和TOMCAT配置保持一致,并避免冲突,否则启动TOMCAT将失败.
3、配置Tomcat
安装多个TOMCAT(ZIP版本,不要安装"安装版本")
修改TOMCAT安装目录下conf/server.xml
如修改tomcat_1配置
修改:
<Server port="8105" shutdown="SHUTDOWN">
修改:
<Connectorport="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8143" />
修改:
<Connectorport="8109" protocol="AJP/1.3" redirectPort="8143" />
修改:
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
修改另外几个tomcat文件,并避免端口冲突.如果多个TOMCAT安装在多个服务器则只要注意IP地址的正确.
4、保持Session同步
在TOMCAT安装目录conf/server.xml下的
<Engine>... </Engine>标签下填加如下内容:
- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="4">
<ManagerclassName="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true" />
- <!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
- <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
- <Channel className="org.apache.catalina.tribes.group.GroupChannel">
<MembershipclassName="org.apache.catalina.tribes.membership.McastService" address="228.0.0.4" port="45564" frequency="500" dropTime="3000" />
<ReceiverclassName="org.apache.catalina.tribes.transport.nio.NioReceiver" address="auto" port="4001" autoBind="100" selectorTimeout="5000" maxThreads="6" />
- <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
<TransportclassName="org.apache.catalina.tribes.transport.nio.PooledParallelSender" />
</Sender>
<InterceptorclassName="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector" />
<InterceptorclassName="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor" />
</Channel>
<ValveclassName="org.apache.catalina.ha.tcp.ReplicationValve" filter="" />
<ValveclassName="org.apache.catalina.ha.session.JvmRouteBinderValve" />
<DeployerclassName="org.apache.catalina.ha.deploy.FarmWarDeployer" tempDir="/tmp/war-temp/" deployDir="/tmp/war-deploy/" watchDir="/tmp/war-listen/" watchEnabled="false" />
<ClusterListenerclassName="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener" />
<ClusterListenerclassName="org.apache.catalina.ha.session.ClusterSessionListener" />
</Cluster>
#注意port="4001" 是否与其他TOMCAT进程冲突.
配置详细解释见文档"Clustering-Session Replication HOW-TO.htm"
5、修改WEB项目Web.xml
在工程项目中修改web.xml;
填加如下标签:
<distributable/>
6、Testing
打开浏览器,写一个简单的JSP,测试
http://localhost/mytest/index.jsp
http://localhost/mytest:8109/index.jsp
http://localhost/mytest:8209/index.jsp
http://localhost/mytest:8309/index.jsp
http://localhost/mytest:8409/index.jsp
http://localhost/mytest:8509/index.jsp
7、QA
问:如何配置多个服务器?
答:修改Apache 下httpd.conf文件;
把
<Proxy balancer://tomcatcluster>
BalancerMember ajp://localhost:8109 smax=10 route=jvm1
BalancerMember ajp://localhost:8209 smax=10 route=jvm2
BalancerMember ajp://localhost:8309 smax=10 route=jvm3
BalancerMember ajp://localhost:8409 smax=10 route=jvm4
BalancerMember ajp://localhost:8509 smax=10 route=jvm5
</Proxy>
中的localhost改成内部服务器IP地址就OK了.
问:为什么启动多个TOMCAT进程失败?
答:注意配置的TOMCAT服务各个端口是否有冲突.
问:为什么session不能保持一致?
答:需要注意以下几点:
All your session attributes must implement java.io.Serializable
If you have defined custom cluster valves, make sure you have the ReplicationValve defined as well under the Cluster element in server.xml
If your Tomcat instances are running on the same machine, make sure the tcpListenPort attribute is unique for each instance, in most cases Tomcat is smart enough to resolve this on it's own by autodetecting available ports in the range 4000-4100
Make sure your web.xml has the <distributable/> element or set at your <Context distributable="true" />
Make sure that all nodes have the same time and sync with NTP service!
Make sure that your loadbalancer is configured for sticky session mode.
1、下载和安装。
下载安装apache2.2.3,tomcat6.0.(注意设置环境变量)
2、配置Apache
修改Apache安装目录下conf/httpd.conf文件.
由
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
修改为:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
填加以下内容(注意此配置是在1台PC开多TOMCAT进程,并注意注释的格式):
# ProxyRequests Off
#
ProxyPass / balancer://tomcatcluster/ lbmethod=byrequests stickysession=JSESSIONID nofailover=Off timeout=3 maxattempts=3
###################################################################
#
# IBmethod:
# Balancer load-balance method. Select the load-balancing scheduler method to use. Either byrequests, to perform weighted request counting or bytraffic, to perform weighted traffic byte #count balancing. Default is byrequests.
#
# stickysession:
# Balancer sticky session name. The value is usually set to something like JSESSIONID or #PHPSESSIONID, and it depends on the backend application server that # support sessions.
#
# nofailover:
# If set to On the session will break if the worker is in error state or disabled. Set this value #to On if backend servers do not support session
# replication.
#
# timeout:
# Balancer timeout in seconds. If set this will be the maximum time to wait for a free worker. #Default is not to wait.
#
# maxattempts:
# Maximum number of failover attempts before giving up.
####################################################################################
ProxyPassReverse / balancer://tomcatcluster/
<Proxy balancer://tomcatcluster>
BalancerMember ajp://localhost:8109 smax=10 route=jvm1
BalancerMember ajp://localhost:8209 smax=10 route=jvm2
BalancerMember ajp://localhost:8309 smax=10 route=jvm3
BalancerMember ajp://localhost:8409 smax=10 route=jvm4
BalancerMember ajp://localhost:8509 smax=10 route=jvm5
</Proxy>
# smax:
# Upto the Soft Maximum number of connections will be created on demand. Any connections above smax are subject to a time to live or ttl.
# route:
# Route of the worker when used inside load balancer. The route is a value appended to seesion id.
注意端口号和TOMCAT配置保持一致,并避免冲突,否则启动TOMCAT将失败.
3、配置Tomcat
安装多个TOMCAT(ZIP版本,不要安装"安装版本")
修改TOMCAT安装目录下conf/server.xml
如修改tomcat_1配置
修改:
<Server port="8105" shutdown="SHUTDOWN">
修改:
<Connectorport="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8143" />
修改:
<Connectorport="8109" protocol="AJP/1.3" redirectPort="8143" />
修改:
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
修改另外几个tomcat文件,并避免端口冲突.如果多个TOMCAT安装在多个服务器则只要注意IP地址的正确.
4、保持Session同步
在TOMCAT安装目录conf/server.xml下的
<Engine>... </Engine>标签下填加如下内容:
- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="4">
<ManagerclassName="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true" />
- <!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
- <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
- <Channel className="org.apache.catalina.tribes.group.GroupChannel">
<MembershipclassName="org.apache.catalina.tribes.membership.McastService" address="228.0.0.4" port="45564" frequency="500" dropTime="3000" />
<ReceiverclassName="org.apache.catalina.tribes.transport.nio.NioReceiver" address="auto" port="4001" autoBind="100" selectorTimeout="5000" maxThreads="6" />
- <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
<TransportclassName="org.apache.catalina.tribes.transport.nio.PooledParallelSender" />
</Sender>
<InterceptorclassName="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector" />
<InterceptorclassName="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor" />
</Channel>
<ValveclassName="org.apache.catalina.ha.tcp.ReplicationValve" filter="" />
<ValveclassName="org.apache.catalina.ha.session.JvmRouteBinderValve" />
<DeployerclassName="org.apache.catalina.ha.deploy.FarmWarDeployer" tempDir="/tmp/war-temp/" deployDir="/tmp/war-deploy/" watchDir="/tmp/war-listen/" watchEnabled="false" />
<ClusterListenerclassName="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener" />
<ClusterListenerclassName="org.apache.catalina.ha.session.ClusterSessionListener" />
</Cluster>
#注意port="4001" 是否与其他TOMCAT进程冲突.
配置详细解释见文档"Clustering-Session Replication HOW-TO.htm"
5、修改WEB项目Web.xml
在工程项目中修改web.xml;
填加如下标签:
<distributable/>
6、Testing
打开浏览器,写一个简单的JSP,测试
http://localhost/mytest/index.jsp
http://localhost/mytest:8109/index.jsp
http://localhost/mytest:8209/index.jsp
http://localhost/mytest:8309/index.jsp
http://localhost/mytest:8409/index.jsp
http://localhost/mytest:8509/index.jsp
7、QA
问:如何配置多个服务器?
答:修改Apache 下httpd.conf文件;
把
<Proxy balancer://tomcatcluster>
BalancerMember ajp://localhost:8109 smax=10 route=jvm1
BalancerMember ajp://localhost:8209 smax=10 route=jvm2
BalancerMember ajp://localhost:8309 smax=10 route=jvm3
BalancerMember ajp://localhost:8409 smax=10 route=jvm4
BalancerMember ajp://localhost:8509 smax=10 route=jvm5
</Proxy>
中的localhost改成内部服务器IP地址就OK了.
问:为什么启动多个TOMCAT进程失败?
答:注意配置的TOMCAT服务各个端口是否有冲突.
问:为什么session不能保持一致?
答:需要注意以下几点:
All your session attributes must implement java.io.Serializable
If you have defined custom cluster valves, make sure you have the ReplicationValve defined as well under the Cluster element in server.xml
If your Tomcat instances are running on the same machine, make sure the tcpListenPort attribute is unique for each instance, in most cases Tomcat is smart enough to resolve this on it's own by autodetecting available ports in the range 4000-4100
Make sure your web.xml has the <distributable/> element or set at your <Context distributable="true" />
Make sure that all nodes have the same time and sync with NTP service!
Make sure that your loadbalancer is configured for sticky session mode.
发表评论
-
如何将tomcat控制台输出的内容直播用日志文件保存起来
2010-01-12 19:40 5814http://topic.csdn.net/u/2009111 ... -
tomcat+apache+terracotta做集群
2010-01-05 19:37 1489http://huaiyude06.iteye.com/blo ... -
Apache+tomcat集群 中文乱码问题解决方法
2009-10-09 17:00 2506http://blog.csdn.net/shaohui/ar ... -
Tomcat 在IE中下载rar文件直接以乱码方式打开解决方案
2009-08-20 14:26 1210http://taosst.iteye.com/blog/28 ... -
关于tomcat虚拟路径配置
2009-08-20 14:17 3459http://blog.sina.com.cn/s/blog_ ... -
Java 中文问题的解决 mysql, oracle, servlet, jsp
2009-05-11 17:11 1180[url]http://blog.csdn.net/ariel ... -
tomcat控制浏览器不缓存
2009-01-09 17:32 9687http://xinsync.xju.edu.cn/index ... -
tomcat根目录
2008-10-16 08:41 1753正常情况下,我们访问tomcat都是通过http://XXXX ...
相关推荐
标题中的“tomcat5.5 + tomcat 6.0”指的是Apache Tomcat服务器的两个不同版本。Tomcat是一款开源的Java Servlet容器,主要用于运行Java Web应用程序,包括JSP和Servlet。这两个版本分别代表了Tomcat在不同时间点的...
直接下载, 即可用 apache2.4+tomcat 7 集群配置
### Apache 2.2 + Tomcat 6.0 + MySQL 5.0 + mod_jk 整合 本文旨在深入探讨如何将Apache 2.2、Tomcat 6.0、MySQL 5.0以及mod_jk进行有效的整合,以构建一个高性能、可扩展的应用服务器环境。这种整合方式不仅能够...
Tomcat6.0是一款遵循Apache Software Foundation的Jakarta项目下的Servlet和JavaServer Pages (JSP) 规范的应用服务器,主要处理Java Web应用程序。它轻量级、高效且开源,是许多开发者的首选。 3. **整合背景** ...
Apache2.2与Tomcat6.0的组合可以构建一个高效、可靠的负载均衡服务器系统,以分散客户端请求到多个后端应用服务器,提高整体服务的可用性和响应速度。以下是搭建和配置的关键步骤及知识点: 1. **Apache2.2安装配置...
本教程将探讨如何在一台机器上配置Apache 2.2.15与Tomcat 6.0的集群,以实现负载均衡和提高服务的可用性。 首先,Apache 2.2.15是Apache HTTP Server的一个版本,它提供了强大的静态内容处理能力和与其他服务器的...
Apache2.2与Tomcat6.0的组合可以创建一个高效能、高可用性的Web服务器环境,通过负载均衡技术,可以有效地分散用户请求到多个Tomcat实例,从而提高系统的响应速度和整体性能。以下是关于这个配置的详细知识讲解: 1...
"两台服务器上做Apache2.2+Tomcat6.0+mod_jk的负载均衡"是一个典型的分布式系统架构,旨在通过在多台服务器之间分配工作负载来提高系统的稳定性和性能。下面将详细介绍这个配置涉及的知识点: 1. **Apache ...
### MyEclipse 5.5 + Tomcat 6.0 + 最快捷汉化搭建系统开发平台 #### 一、概述 随着Java技术的发展,越来越多的企业和个人开发者选择使用集成开发环境(IDE)来提高开发效率。MyEclipse作为一款功能强大的Java EE...
Apache 2.2.4 和 Tomcat 6.0 的整合配置是一项常见的任务,尤其在部署Java Web应用程序时。这两个组件分别作为Web服务器和应用服务器,通过特定的方式协同工作,以提供动态内容服务。这里我们将深入探讨这个整合过程...
在本文中,我们将深入探讨如何搭建一个基于MyEclipse 6.5、Flex 3、Tomcat 6.0和ds-console.war的开发环境。这个环境主要用于开发和部署使用Flex前端与Java后端交互的应用程序,特别是通过LCDS(LiveCycle Data ...
Apache2.4+Tomcat8.0集群安装--测试项目。集群配置地址为:
在这个解压版中,包含了Tomcat的两个不同版本:Tomcat 5.5和Tomcat 6.0。 Tomcat 5.5是在2005年发布的,它是Tomcat的一个重要版本,引入了许多新特性和改进。其中,最重要的是对Servlet 2.4和JSP 2.0规范的支持,这...
Apache 2.4 和 Tomcat 7 集群配置是一种常见的Web服务器和应用服务器部署方式,用于提高网站和应用程序的可伸缩性和高可用性。在Windows 7环境下搭建这样的集群,我们可以实现负载均衡、故障转移等功能,以确保服务...
在Apache和Tomcat的场景中,Apache作为前端代理服务器,接收来自用户的请求,然后根据预定义的策略将这些请求分发到后端的Tomcat服务器集群。 **Apache HTTP Server配置:** 1. **安装mod_proxy模块**:Apache的...
标题"tomcat5.5和tomcat6.0"指的是Apache Tomcat的两个不同版本,即5.5版和6.0版。Tomcat是一款开源的Java Servlet容器,它实现了Java EE的Web部分,包括Servlet和JSP规范。描述中提到,Tomcat具有技术先进、性能...
Apache2.2与Tomcat6.0的集成配置是一个常见的软件开发任务,特别是在构建高性能、高可用性的Web应用服务器环境中。Apache作为静态内容处理的强力HTTP服务器,与Tomcat(一个流行的Java Servlet容器)结合使用,可以...
在Windows XP操作系统上搭建一个完整的Web开发环境,包括Apache Web Server 2.2、PHP 5.2.9.2、MySQL 6.0、Tomcat 6.0以及JSP整合,是一个常见的需求,特别是在进行多语言动态网站开发时。这个压缩包提供了一整套的...
标题与描述均聚焦于“Flex4.5 + Tomcat6.0 + MyEclipse 9.0+ Java+Blazeds环境配置和使用”,这一主题涉及了多种技术栈的集成,包括Flex4.5(FlashBuilder)、Tomcat6.0、MyEclipse 9.0、Java以及Blazeds。...