Tomcat 负载均衡配置win8版Word格式.docx
《Tomcat 负载均衡配置win8版Word格式.docx》由会员分享,可在线阅读,更多相关《Tomcat 负载均衡配置win8版Word格式.docx(17页珍藏版)》请在冰豆网上搜索。
![Tomcat 负载均衡配置win8版Word格式.docx](https://file1.bdocx.com/fileroot1/2023-1/29/555c220b-b5b5-464b-b69f-06fe56db7713/555c220b-b5b5-464b-b69f-06fe56db77131.gif)
xmlversion='
1.0'
encoding='
utf-8'
>
!
--
LicesedtotheApacheSoftwareFoundation(ASF)underoneormore
contributorlicenseagreements.SeetheNOTICEfiledistributedwith
thisworkforadditionalinformationregardingcopyrightownership.
TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0
(the"
License"
);
youmaynotusethisfileexceptincompliancewith
theLicense.YoumayobtainacopyoftheLicenseat
http:
//www.apache.org/licenses/LICENSE-2.0
Unlessrequiredbyapplicablelaworagreedtoinwriting,software
distributedundertheLicenseisdistributedonan"
ASIS"
BASIS,
WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
SeetheLicenseforthespecificlanguagegoverningpermissionsand
limitationsundertheLicense.
-->
--Note:
A"
Server"
isnotitselfa"
Container"
soyoumaynot
definesubcomponentssuchas"
Valves"
atthislevel.
Documentationat/docs/config/server.html
-->
Serverport="
8015"
shutdown="
SHUTDOWN"
<
--APRlibraryloader.Documentationat/docs/apr.html-->
ListenerclassName="
org.apache.catalina.core.AprLifecycleListener"
SSLEngine="
on"
/>
--InitializeJasperpriortowebappsareloaded.Documentationat/docs/jasper-howto.html-->
org.apache.catalina.core.JasperListener"
--Preventmemoryleaksduetouseofparticularjava/javaxAPIs-->
org.apache.catalina.core.JreMemoryLeakPreventionListener"
--JMXSupportfortheTomcatserver.Documentationat/docs/non-existent.html-->
org.apache.catalina.mbeans.ServerLifecycleListener"
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
--GlobalJNDIresources
Documentationat/docs/jndi-resources-howto.html
GlobalNamingResources>
--Editableuserdatabasethatcanalsobeusedby
UserDatabaseRealmtoauthenticateusers
Resourcename="
UserDatabase"
auth="
type="
org.apache.catalina.UserDatabase"
description="
Userdatabasethatcanbeupdatedandsaved"
factory="
org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="
conf/tomcat-users.xml"
/GlobalNamingResources>
--A"
Service"
isacollectionofoneormore"
Connectors"
thatshare
asingle"
Note:
soyoumaynotdefinesubcomponentssuchas"
Documentationat/docs/config/service.html
Servicename="
Catalina"
--Theconnectorscanuseasharedexecutor,youcandefineoneormorenamedthreadpools-->
Executorname="
tomcatThreadPool"
namePrefix="
catalina-exec-"
maxThreads="
150"
minSpareThreads="
4"
/>
Connector"
representsanendpointbywhichrequestsarereceived
andresponsesarereturned.Documentationat:
JavaHTTPConnector:
/docs/config/http.html(blocking&
non-blocking)
JavaAJPConnector:
/docs/config/ajp.html
APR(HTTP/AJP)Connector:
/docs/apr.html
Defineanon-SSLHTTP/1.1Connectoronport8080
--下面是配置连接属性,如果不用连接池请删除executor="
属性当然你可以对照原始server.xml文件删除连接中的多余属性,那些多余属性只是影响连接性能(是否保持最大最小线程数是否压缩等)-->
Connectorport="
8088"
protocol="
HTTP/1.1"
xecutor="
onnectionTimeout="
20000"
redirectPort="
8443"
compression="
no"
mpressionMinSize="
2048"
noCompressionUserAgents="
gozilla,traviata"
compressableMimeType="
text/html,text/xml,text/css,text/javascript,text/plain"
URIEncoding="
utf-8"
enableLookups="
false"
usingthesharedthreadpool-->
<
--下面是配置连接池可以不用下面连接池,但是请删除上面连接的executor="
属性-->
Connectorexecutor="
maxThreads="
500"
minSpareThreads="
30"
maxSpareThreads="
50"
maxIdleTime="
60000"
keepAliveTimeout="
15000"
maxKeepAliveTimeout="
200"
--DefineaSSLHTTP/1.1Connectoronport8443
ThisconnectorusestheJSSEconfiguration,whenusingAPR,the
connectorshouldbeusingtheOpenSSLstyleconfiguration
describedintheAPRdocumentation-->
--下面配置安全访问协议https这不是必须的,你可以注释掉,当然倘若你注释了它,当浏览器访问安全协议网站时(https)就会出现问题,不过当你打算采用时,你需要配置个人加密安全证书mykey.keystore配置该安全证书请XX搜索,或者参见注释4)-->
SSLEnabled="
true"
25"
75"
disableUploadTimeout="
acceptCount="
100"
scheme="
https"
secure="
clientAuth="
sslProtocol="
TLS"
keystoreFile="
conf/mykey.keystore"
keystorePass="
111111"
--DefineanAJP1.3Connectoronport8009-->
--下面配置的连接用于apache控制器需要连接到该tomcat的地址-->
8008"
AJP/1.3"
URIEncoding="
--AnEnginerepresentstheentrypoint(withinCatalina)thatprocesses
everyrequest.TheEngineimplementationforTomcatstandalone
analyzestheHTTPheadersincludedwiththerequest,andpassesthem
ontotheappropriateHost(virtualhost).
Documentationat/docs/config/engine.html-->
--YoushouldsetjvmRoutetosupportload-balancingviaAJPie:
Enginename="
defaultHost="
localhost"
jvmRoute="
jvm1"
--下面这行是必须的注意jvmRoute属性请填写我门拷贝改名的tomcat服务器文件夹-->
tomcat1"
--Forclustering,pleasetakealookatdocumentationat:
/docs/cluster-howto.html(simplehowto)
/docs/config/cluster.html(referencedocumentation)-->
--下面这行也是必须的用于集成服务,我们采用apache服务器的目的就是集成服务-->
ClusterclassName="
org.apache.catalina.ha.tcp.SimpleTcpCluster"
--Therequestdumpervalvedumpsusefuldebugginginformationabout
therequestandresponsedatareceivedandsentbyTomcat.
Documentationat:
/docs/config/valve.html-->
ValveclassName="
org.apache.catalina.valves.RequestDumperValve"
--ThisRealmusestheUserDatabaseconfiguredintheglobalJNDI
resourcesunderthekey"
.Anyedits
thatareperformedagainstthisUserDatabaseareimmediately
availableforusebytheRealm.-->
--下面这行请保持默认或者打开注释-->
RealmclassName="
org.apache.catalina.realm.UserDatabaseRealm"
resourceName="
--Definethedefaultvirtualhost
XMLSchemavalidationwillnotworkwithXerces2.2.
Hostname="
appBase="
webapps"
unpackWARs="
autoDeploy="
xmlValidation="
xmlNamespaceAware="
--SingleSignOnvalve,shareauthenticationbetweenwebapplications
org.apache.catalina.authenticator.SingleSignOn"
--Accesslogprocessesallexample.
--下面这行必须的但是更改他可以提高tomcat日志效率-->
org.apache.catalina.valves.FastCommonAccessLogValve"
directory="
logs"
prefix="
localhost_access_log."
suffix="
.txt"
pattern="
combined"
resolveHosts="
fileDateFormat="
yyyy-MM-dd.HH"
/Host>
/Engine>
/Service>
/Server>
注意:
蓝色部分中的端口配置,tomcat1和tomcat2的配置不同,如果需要可以将本置拷贝到server.xml文件中拷贝时请删除中文注释。
\tomcat2\onf\server.xml):
就不再注释
LicensedtotheApacheSoftwareFoundation(ASF)underoneormore
9015"
org.apach