锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲成AV人片在线观看WWW,亚洲成a人片在线观看国产,亚洲天堂一区二区http://www.tkk7.com/xiaomage234/category/53838.html鐢熷懡鏈氨鏄竴嬈″噭緹庣殑婕傛祦錛岃蹇嗕腑鏀句笉涓嬬殑錛屾案榪滄槸瀛╂彁鏃朵唬鐨勯偅涓浠芥氮婕笌綰湡錛?/description>zh-cnThu, 12 Oct 2017 15:00:50 GMTThu, 12 Oct 2017 15:00:50 GMT60杞細 Nginx + Tomcat + HTTPS 閰嶇疆涓嶉渶瑕佸湪 Tomcat 涓婂惎鐢?SSL 鏀寔http://www.tkk7.com/xiaomage234/archive/2017/10/12/432853.html灝忛┈姝?/dc:creator>灝忛┈姝?/author>Thu, 12 Oct 2017 03:02:00 GMThttp://www.tkk7.com/xiaomage234/archive/2017/10/12/432853.htmlhttp://www.tkk7.com/xiaomage234/comments/432853.htmlhttp://www.tkk7.com/xiaomage234/archive/2017/10/12/432853.html#Feedback0http://www.tkk7.com/xiaomage234/comments/commentRss/432853.htmlhttp://www.tkk7.com/xiaomage234/services/trackbacks/432853.html

鏈榪戝仛浜嗕釜Web欏圭洰, 鏋舵瀯涓婁嬌鐢ㄤ簡 Nginx +tomcat 闆嗙兢, 涓斿叏绔橦TTPS錛岀敤nginx 鍋氳礋杞斤紝nginx鍜宼omcat 浣跨敤鍐呯綉http閫氫俊錛岄亣鍒癶ttp css錛宩s闈欐佽祫婧愯嫻忚鍣ㄦ嫤鎴棶棰橈紝緗戜笂鎼滅儲鍒扮殑寰堝鏂囩珷鍦ㄦ弿榪?Nginx + Tomcat 鍚敤 HTTPS 鏀寔鐨勬椂鍊欙紝閮藉繀欏誨湪 Nginx 鍜?Tomcat 涓よ竟鍚屾椂閰嶇疆 SSL 鏀寔錛屼粖澶╁仛涓葷粨銆?/p>

閬囧埌闂

  1. nginx寮哄埗浣跨敤https璁塊棶(http璺寵漿鍒癶ttps)
  2. http鐨刯s錛宑ss 絳夐潤鎬佽祫婧愯嫻忚鍣ㄦ嫤鎴紙http涓嶈淇′換錛?/li>

鏈鍚庣殑瑙e喅鏂規

棣栧厛瑙e喅絎竴涓棶棰?/strong>鍏ㄧ珯https 
鍙傝?/a> 
涓夌鏂瑰紡錛岃窡澶у鍏變韓涓涓?/p>

nginx鐨剅ewrite鏂規硶

server {   listen  192.168.1.111:80;   server_name test.com;   rewrite ^(.*)$  https://$host$1 permanent; }   

nginx鐨?97鐘舵佺爜錛屾垜閫夋嫨浜嗚繖縐嶆柟寮?/strong>

server {       listen       192.168.1.11:443;  #ssl绔彛       listen       192.168.1.11:80;   #鐢ㄦ埛涔犳儻鐢╤ttp璁塊棶錛屽姞涓?0錛屽悗闈㈤氳繃497鐘舵佺爜璁╁畠鑷姩璺沖埌443绔彛       server_name  test.com;       #涓轟竴涓猻erver{......}寮鍚痵sl鏀寔       ssl                  on;       #鎸囧畾PEM鏍煎紡鐨勮瘉涔︽枃浠?       ssl_certificate      /etc/nginx/test.pem;        #鎸囧畾PEM鏍煎紡鐨勭閽ユ枃浠?      ssl_certificate_key  /etc/nginx/test.key;        #璁﹉ttp璇鋒眰閲嶅畾鍚戝埌https璇鋒眰        error_page 497  https://$host$uri?$args;   }   

index.html鍒鋒柊緗戦〉

<html>   <meta http-equiv="refresh" content="0;url=https://test.com/">   </html>  

褰揾ttp璁塊棶鍒癷ndex.html鏃跺欒嚜鍔ㄨ煩杞埌https


鎺ヤ笅鏉ヨВ鍐?strong style="box-sizing: border-box;">絎簩涓棶棰?/strong> 
濡傛灉tomcat 鍜宯ginx 鍙屾柟娌℃湁閰嶇疆X-Forwarded-Proto tomcat灝變笉鑳芥紜尯鍒嗗疄闄呯敤鎴鋒槸http 榪樻槸https錛屽鑷磘omcat 閲岄厤緗殑闈欐佽祫婧愯璁や負鏄痟ttp鑰岃嫻忚鍣ㄦ嫤鎴紝request.getScheme()鎬繪槸 http錛岃屼笉鏄疄闄呯殑http鎴杊ttps

鍒嗗埆閰嶇疆涓涓?Nginx 鍜?Tomcat 錛屾灉鐒跺ソ浜嗐?nbsp;
閰嶇疆 Nginx 鐨勮漿鍙戦夐」錛?/strong>

 proxy_set_header       Host $host;       proxy_set_header  X-Real-IP  $remote_addr;       proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;       proxy_set_header X-Forwarded-Proto  $scheme;  
  • 1
  • 2
  • 3
  • 4

閰嶇疆Tomcat server.xml 鐨?Engine 妯″潡涓嬮厤緗竴涓?Valve錛?/strong>

<Valve className="org.apache.catalina.valves.RemoteIpValve"   remoteIpHeader="X-Forwarded-For"   protocolHeader="X-Forwarded-Proto"   protocolHeaderHttpsValue="https"/>  
  • 1
  • 2
  • 3
  • 4

闈?0绔彛閰嶇疆 
Nginx澧炲姞浠ヤ笅閰嶇疆 
proxy_set_header Host $host:$server_port; 闈?0绔彛 錛岀敤80绔彛鏃?涓嶉渶瑕?server_port 
proxy_set_header X-Real-IP $remote_addr; 
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
proxy_set_header X-Forwarded-Proto $scheme; 

Tomcat server.xml閰嶇疆 
<Engine name="Catalina" defaultHost="localhost"> 
<Valve className="org.apache.catalina.valves.RemoteIpValve" 
remoteIpHeader="X-Forwarded-For" 
protocolHeader="X-Forwarded-Proto" 
protocolHeaderHttpsValue="https" httpsServerPort="7001"/> 闈?0绔彛鏃訛紝蹇呴』澧炲姞httpsServerPort閰嶇疆錛屼笉鐒秗equest.getServerPort()鏂規硶榪斿洖 443. 
</Engine>

鍏充簬 RemoteIpValve,鍙互闃呰涓?doc

http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html



]]>
Tomcat7璋冭瘯榪愯鐜鎼緩涓庢簮浠g爜鍒嗘瀽鍏ラ棬http://www.tkk7.com/xiaomage234/archive/2015/12/24/428814.html灝忛┈姝?/dc:creator>灝忛┈姝?/author>Thu, 24 Dec 2015 07:54:00 GMThttp://www.tkk7.com/xiaomage234/archive/2015/12/24/428814.htmlhttp://www.tkk7.com/xiaomage234/comments/428814.htmlhttp://www.tkk7.com/xiaomage234/archive/2015/12/24/428814.html#Feedback0http://www.tkk7.com/xiaomage234/comments/commentRss/428814.htmlhttp://www.tkk7.com/xiaomage234/services/trackbacks/428814.html鍘熸枃  http://zhh2009.iteye.com/blog/1557891


1. 闇瑕佸噯澶囧ソ涓嬮潰榪欎簺宸ュ叿

 

JDK 1.6+

Maven 2鎴?

TortoiseSVN 1.7+ (浠?.7寮濮?.svn"鐩綍闆嗕腑鏀懼湪涓澶勪簡錛屼笉鍐嶆瘡涓洰褰曚笅閮芥斁涓浠?

Eclipse 3.5+

 

榪?涓伐鍏蜂笉鍦ㄨ繖閲屾弿榪版庝箞閰嶇疆浜嗭紝濡傛灉浣犳槸鏈変袱涓夊勾寮鍙戠粡楠岀殑Java寮鍙戜漢鍛橈紝姝e父鏉ヨ閮戒竴鐩村湪鐢ㄤ簡銆?/p>

鍙﹀錛屽垎鏋恡omcat婧愪唬鐮佷笉闇瑕佸榪?涓伐鍏峰仛浠涔堢壒孌婇厤緗?/p>

 

 

 

2. 涓嬭澆Tomcat鐨勬簮浠g爜

 

Apache鏃椾笅鐨勫紑婧愰」鐩熀鏈笂閮芥斁鍦ㄨ繖: http://svn.apache.org/repos/asf

閲岄潰鍖呭惈浜唗omcat銆乻truts銆乭adoop銆乭base絳夋祦琛岀殑寮婧愰」鐩殑婧愪唬鐮侊紝

鍙互鐩存帴鐢ㄦ祻瑙堝櫒鎵撳紑榪欎釜URL錛屾垨鑰呯敤TortoiseSVN鐨凴epository Browser鎵撳紑瀹冦?/p>

tomcat鐨剆vn鏄? http://svn.apache.org/repos/asf/tomcat , 濡備笅鍥炬墍紺?


 

鐩墠tomcat鏈?涓ぇ鍒嗘敮: 

5.5 : http://svn.apache.org/repos/asf/tomcat/tc5.5.x

6.0 : http://svn.apache.org/repos/asf/tomcat/tc6.0.x

7.0 : http://svn.apache.org/repos/asf/tomcat/tc7.0.x

8.0 : http://svn.apache.org/repos/asf/tomcat/trunk

 

5.5鍒嗘敮浼氬湪浠婂勾9鏈?0鍙峰悗鍋滄緇存姢錛屾墍浠ラ櫎闈炴湁鍘嗗彶閬楃暀緋葷粺錛屼笉鎺ㄨ崘鍐嶅幓璇誨畠鐨勪唬鐮侊紝

 

6.0鍒嗘敮鏄瘮杈冩垚鐔熺殑錛屽湪鐢熶駭鐜鐢ㄥ緱姣旇緝澶氾紝

鐩墠瀹樻柟瀵硅繖涓垎鏀繘鍏ョ淮鎶ゃ乥ugfix闃舵錛屽緢灝戞湁鏂板姛鑳芥坊鍔犺繘鏉ヤ簡錛?/p>

鎴戜釜浜轟篃涓嶆帹鑽愯瀹冪殑浠g爜錛屼唬鐮佺浉瀵?.0鏉ヨ姣旇緝鑴忎貢銆?/p>

 

7.0鍒嗘敮瀹屾暣瀹炵幇浜唖ervlet 3.0瑙勮寖錛屽凡闄嗙畫鍙戝竷浜?7涓皬鐗堟湰錛屽繁緇忕ǔ瀹氫簡錛屽彲鐢ㄤ簬鐢熶駭鐜錛?/span>

浠g爜姣?.5銆?.0鍒嗘敮騫插噣鏁存磥寰楀錛岃繖涔熸槸鎴戝己鐑堝悜浣犳帹鑽愮殑鐗堟湰銆?/span>

 

8.0鍒嗘敮涓昏鍏蟲敞web socket鍜宻pdy錛屾澶勪簬媧昏穬寮鍙戦樁孌碉紝浠g爜鍙樺姩姣旇緝棰戠箒錛屼繚鎸佸叧娉ㄥ嵆鍙?/p>

 

 

鎵浠ヨ繖綃囨枃绔犺鐨勬槸7.0鍒嗘敮錛岀爺絀秚omcat鎺ㄨ崘鐩存帴鎻愬彇svn鐨勬簮浠g爜:

 

鐢═ortoiseSVN checkout榪欎釜svn鐨勪唬鐮?http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk

鏀懼埌D:\Tomcat7\trunk (浣犲彲浠ユ崲鍒殑鐩綍)

 

鐒跺悗鍐嶄粠榪欎笅杞戒竴涓簩榪涘埗鍒嗗彂鍖?Binary Distributions)

http://labs.mop.com/apache-mirror/tomcat/tomcat-7/v7.0.27/bin/apache-tomcat-7.0.27.zip

 

瑙e帇鍚庢斁鍒癉:\Tomcat7錛岄『渚挎妸"apache-tomcat-7.0.27"閲嶅懡鍚嶆垚launch鍚э紝

鐢ㄨ繖涓簩榪涘埗鍒嗗彂鍖呰屼笉鏄粠婧愪唬鐮佹瀯寤哄彧鏄負浜嗚妭鐪佹椂闂達紝

鐩存帴鐢ㄥ畠conf鐩綍閲岄潰鐨勯厤緗枃浠跺拰webapps涓嬬殑渚嬪瓙銆?/p>

 

 

3. 鎶婂畠鍙樻垚maven宸ョ▼

 

涓昏鏄坊鍔犲嚑涓緷璧?ecj銆乤nt銆乯axrpc絳?錛屽惁鍒欑殑璇濆鍏clipse鍚庝細鏈夌紪璇戦敊璇紝

鍙﹀錛屽洜涓簍omcat涓嶆槸鏍囧噯鐨刴aven宸ョ▼欏圭洰錛屾瘮濡傛病鏈塻rc\main\java榪欐牱鐨勭洰褰曪紝

鎵浠ヨ璋冩暣涓涓媠ourceDirectory鍜宼estSourceDirectory錛屼笅闈㈡槸涓涓畬鏁寸殑pom鏂囦歡錛?/p>

鐩存帴鏀懼埌D:\Tomcat7鐩綍鍗沖彲(pom.xml涓庝箣鍓嶇殑launch銆乼runk鐩綍騫跺垪)

 

(娉? pom.xml鏂囦歡鍦ㄩ檮浠朵腑)

 

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">  <modelVersion>4.0.0</modelVersion>   <groupId>org.apache.tomcat</groupId>  <artifactId>Tomcat7.0</artifactId>  <name>Tomcat7.0</name>  <version>7.0</version>   <build>   <finalName>Tomcat7.0</finalName>   <sourceDirectory>trunk/java</sourceDirectory>   <testSourceDirectory>trunk/test</testSourceDirectory>   <resources>    <resource>     <directory>trunk/java</directory>    </resource>   </resources>   <testResources>    <testResource>     <directory>trunk/test</directory>    </testResource>   </testResources>   <plugins>    <plugin>     <groupId>org.apache.maven.plugins</groupId>     <artifactId>maven-compiler-plugin</artifactId>     <version>2.3</version>     <configuration>      <source>1.6</source>      <target>1.6</target>     </configuration>    </plugin>   </plugins>  </build>   <dependencies>   <dependency>    <groupId>junit</groupId>    <artifactId>junit</artifactId>    <version>4.4</version>    <scope>test</scope>   </dependency>   <dependency>    <groupId>org.eclipse.jdt.core.compiler</groupId>    <artifactId>ecj</artifactId>    <version>3.7.2</version>   </dependency>   <dependency>    <groupId>ant</groupId>    <artifactId>ant</artifactId>    <version>1.7.0</version>   </dependency>   <dependency>    <groupId>wsdl4j</groupId>    <artifactId>wsdl4j</artifactId>    <version>1.6.2</version>   </dependency>   <dependency>    <groupId>javax.xml</groupId>    <artifactId>jaxrpc</artifactId>    <version>1.1</version>   </dependency>  </dependencies>  </project>
 

 

4. 瀵煎叆Eclipse

 

 

鍦ㄥ懡浠よ紿楀彛涓繘鍏:\Tomcat7鐩綍錛屾墽琛?mvn eclipse:eclipse 灝卞彲浠ヨ漿鎴恊clipse宸ョ▼欏圭洰浜嗭紝

鐒跺悗鎵撳紑eclipse錛岀偣"File->Import->General->Existing Projects into Workspace"錛?/p>

鏈鍚庢墦寮D:\Tomcat7灝辮兘鐪嬪埌Tomcat7.0榪欎釜欏圭洰浜嗐?/p>

 

(濡傛灉eclipse瑁呬簡m2e鎻掍歡涓嶇敤鎵цmvn eclipse:eclipse鐨勶紝鍙互鐩存帴瀵煎叆maven宸ョ▼)

 

 

5. 鍦‥clipse涓Tomcat璺戣搗鏉?/h3>

 

鍦‥clipse涓墦寮org.apache.catalina.startup.Bootstrap綾伙紝

鍦ㄧ紪杈戝尯鍙沖嚮錛岀偣"Run As->Run configurations"錛岀劧鍚庡弻鍑?Java Aplication"灝變細鍑烘潵涓涓柊鐨?Bootstrap"錛?/p>

閫変腑瀹冿紝鍦ㄥ彸杈圭偣鍑?Arguments"閭d竴鏍忥紝鎶婁笅闈㈢殑鍐呭copy鍒?VM arguments"涓?

-Dcatalina.home=launch -Dcatalina.base=launch -Djava.endorsed.dirs=launch/endorsed -Djava.io.tmpdir=launch/temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=launch/conf/logging.properties

 

濡備笅鍥?


 

鐒跺悗鐐箁un鎸夐挳錛屽氨鍙互鍚姩tomcat浜嗭紝鍚姩鎴愬姛浼氬湪Eclipse鐨刢onsole涓樉紺?

 

 

2012-6-10 14:25:31 org.apache.catalina.startup.Catalina start 淇℃伅: Server startup in 359 ms
 

 

 

闄や笂闈㈣繖縐嶆柟寮忓錛岃繖閲岃繕鏈変竴涓狤clipse鐨刲aunch鑴氭湰 (start-tomcat7.launch  (娉? 鍦ㄩ檮浠朵腑) ) 錛?/p>

 

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> <listEntry value="/Tomcat7.0/trunk/java/org/apache/catalina/startup/Bootstrap.java"/> </listAttribute> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listEntry value="1"/> </listAttribute> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.catalina.startup.Bootstrap"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="start"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Tomcat7.0"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.home=launch -Dcatalina.base=launch -Djava.endorsed.dirs=launch/endorsed -Djava.io.tmpdir=launch/temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=launch/conf/logging.properties"/> </launchConfiguration>
 

鍙互鏀懼埌D:\Tomcat7鐩綍錛岀劧鍚巉lush涓涓婨clipse錛屽湪Eclipse涓彸鍑昏繖涓枃浠訛紝鐐筊un As鍚姩Tomcat錛岀偣Debug As鍙互璋冭瘯Tomcat銆?/p>

 

涓嬪浘鏄疶omcat鍦‥clipse涓殑欏圭洰甯冨眬:


 

鏈鍚庯紝鎵撳紑浣犵殑嫻忚鍣紝杈撳叆 http://127.0.0.1:8080/examples/ 鐪嬬湅渚嬪瓙鍚с?/p>

 

 

6. 綆鍗曠殑婧愪唬鐮侀槄璇繪寚鍗?

 

 

鍖呭悕                    鐢ㄩ?================================================= javax                 servlet/jsp/el鐩稿叧鐨刟pi org.apache.catalina   tomcat鑷韓鏋舵瀯 org.apache.coyote     http銆乤jp鍗忚瀹炵幇鐩稿叧鐨勭被 org.apache.el         瀹炵幇el瑙勮寖 org.apache.jasper     瀹炵幇jsp瑙勮寖銆佺紪璇慾sp鏂囦歡 org.apache.juli       tomcat鐨勬棩蹇楃郴緇?org.apache.naming     jndi瀹炵幇 org.apache.tomcat     tomcat鐨勫伐鍏峰寘銆乶et銆乨igester xml瑙f瀽鍣?/pre> 

 

 

闃呰欏哄簭:

 

鍙互浠巓rg.apache.catalina.startup.Bootstrap榪欎釜綾誨紑濮嬬湅璧鳳紝

鐒跺悗鍒皁rg.apache.catalina.startup.Catalina, 

 

鍦–atalina綾諱腑浼氳Е鍙慶onf/server.xml鏂囦歡鐨勮В鏋愶紝

榪欐椂瑕佺湅org.apache.tomcat.util.digester涓殑綾伙紝

瑙f瀽鐨勮繃紼嬩腑浼氱敤鍒皁rg.apache.catalina.startup鍖呬腑鐨勫緢澶歊uleSet綾伙紝

 

server.xml鏂囦歡瑙f瀽瀹屽悗錛屼細鐢熸垚org.apache.catalina.core鍖呬腑鐨勫悇縐峉tandardXXX綾葷殑瀹炰緥錛?/p>

姣斿StandardServer銆丼tandardService銆丼tandardEngine絳夌瓑錛?/p>

榪欎簺Standard緇勪歡閮芥槸鏈夌敓鍛藉懆鏈熺殑錛屾帴鐫浼氳皟鐢ㄤ粬浠殑init銆乻tart絳夋柟娉曪紝

浼氳Е鍙戜笅闈㈣繖浜涚粍浠惰繘鍏nit銆乻tart鐘舵?/p>

org.apache.catalina.connector.Connector

org.apache.coyote.http11.Http11Protocol

org.apache.tomcat.util.net.JIoEndpoint

 

鍦↗IoEndpoint(鎴朜ioEndpoint銆丄prEndpoint)涓細鐩戝惉8080榪欐牱鐨勭鍙o紝

鏈夎姹傝繘鏉ヤ簡錛屽氨榪涜鐩稿叧鐨刬o鎿嶄綔錛屾帴鐫杞埌org.apache.coyote鍖呬腑鐨勭浉搴旂被榪涜鍗忚瑙f瀽錛?/p>

鐢熸垚org.apache.catalina.connector.Request鍜宱rg.apache.catalina.connector.Response瀹炰緥錛?/p>

鐒跺悗杞埌鍚勭Valve銆佸簲鐢‵ilter錛屾渶鍚庡埌杈懼簲鐢ㄧ殑Servlet/JSP銆?/p>

 

涓嬪浘鎻忚堪浜員omcat7鐨勬牳蹇冩灦鏋?


 



]]>zookeeper 澶ч噺榪炴帴鏂紑閲嶈繛鍘熷洜鎺掓煡[杞琞http://www.tkk7.com/xiaomage234/archive/2015/09/10/427237.html灝忛┈姝?/dc:creator>灝忛┈姝?/author>Thu, 10 Sep 2015 02:41:00 GMThttp://www.tkk7.com/xiaomage234/archive/2015/09/10/427237.htmlhttp://www.tkk7.com/xiaomage234/comments/427237.htmlhttp://www.tkk7.com/xiaomage234/archive/2015/09/10/427237.html#Feedback0http://www.tkk7.com/xiaomage234/comments/commentRss/427237.htmlhttp://www.tkk7.com/xiaomage234/services/trackbacks/427237.html

闂鐜拌薄

鏈鍚庡彂鐜扮嚎涓婄殑zookeeper鐨勬棩蹇梲ookeeper.out 鏂囦歡灞呯劧鏈?G錛屽悗鏉ヨ緗笅鏃ュ織涓烘粴鍔ㄨ緭鍑猴紝鍙傝冿細

http://blog.csdn.net/hengyunabc/article/details/19006911

浣嗘槸鏀逛簡涔嬪悗錛屽彂鐜頒竴澶╃殑鏃ュ織閲忓氨鏄?00澶歁錛屾粴鍔ㄦ棩蹇椾竴澶╁氨琚啿鎺変簡錛岃繖涓笉縐戝銆?/p>

鍐嶄粩緇嗘煡鐪嬩笅鏃ュ織閲岀殑鍐呭錛屽彂鐜版湁寰堝榪炴帴寤虹珛濂斤紝椹笂鍙堟柇寮錛?/p>

  1. 2014-11-24 15:38:33,348 [myid:3] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1001] - Closed socket connection for client /10.0.0.3:47772 (no session established for client)  
  2. 2014-11-24 15:38:33,682 [myid:3] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@197] - Accepted socket connection from /10.0.0.3:32119  
  3. 2014-11-24 15:38:33,682 [myid:3] - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@349] - caught end of stream exception  
  4. EndOfStreamException: Unable to read additional data from client sessionid 0x0, likely client has closed socket  
  5.         at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220)  
  6.         at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)  
  7.         at java.lang.Thread.run(Thread.java:745)  
  8. 2014-11-24 15:38:33,682 [myid:3] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1001] - Closed socket connection for client /10.0.0.0:32119 (no session established for client)  
浠庢棩蹇楄緭鍑虹殑鏃墮棿鏉ョ湅錛岀榪炵鏂紝闈炲父璇″紓銆?/span>

鎺掓煡闂

鐢╪etstat鏌ョ湅緗戠粶榪炴帴鐘舵?/h3>

鍒癱lient鐨勬湇鍔″櫒涓婃煡鐪嬭繛鎺ョ殑鐘舵侊細

  1. netstat -antp | grep 2181  

鍙戠幇鏈夊緢澶歍IME_WAIT鐘舵佺殑榪炴帴錛?/span>

  1. tcp        0      0 10.0.0.3:44269         10.0.1.77:2181         TIME_WAIT   -                     
  2. tcp        0      0 10.0.0.3:43646         10.0.1.77:2181         TIME_WAIT   -                     
  3. tcp        0      0 10.0.0.3:44184         10.0.1.77:2181         TIME_WAIT   -                     
  4. tcp        0      0 10.0.0.3:44026         10.0.1.77:2181         TIME_WAIT   -                     
  5. tcp        0      0 10.0.0.3:43766         10.0.1.77:2181         TIME_WAIT   -    

浣嗘槸TIME_WAIT鐘舵佺殑榪炴帴鏄湅涓嶅埌榪涚▼鍙風殑銆傛悳绱㈢爺絀朵簡涓媙etstat鐨勫弬鏁幫紝鍙戠幇娌℃湁鍔炴硶杈撳嚭TIME_WAIT鐘舵佺殑榪炴帴鐨刾id錛屽彧濂藉皾璇曞叾瀹冪殑鍔炴硶銆?/span>

鍐嶇敤 jstack -l pid 鏉ユ煡鐪嬭繘紼嬬殑綰跨▼鏍堬紝涔熸病鏈夊彂鐜頒粈涔堝紓甯哥殑涓滀笢銆傛煡鐪嬪埌鏈夊嚑涓獄ookeeper榪炴帴鐨勭嚎紼嬶紝浣嗕篃鏄甯哥姸鎬併?br />

鍐嶆鏌ヤ簡鏈哄櫒鐨処O錛孋PU錛屽唴瀛橈紝涔熸病鏈夊紓甯哥殑鎯呭喌銆?/p>

娌℃壘鍒頒粈涔堟湁鐢ㄧ殑淇℃伅錛屽彧濂藉啀鐮旂┒涓媙etstat鐨勫弬鏁幫細
鍙戠幇鐢?netstat -ae 杈撳嚭浜嗕竴浜涗俊鎭細

  1. tcp        0      0 10.0.0.3:41772     10.0.1.77:eforward     TIME_WAIT   root       0            
  2. tcp        0      0 10.0.0.3:41412     10.0.1.77:eforward     TIME_WAIT   root       0            
  3. tcp        0      0 10.0.0.3:24226     10.0.1.77:2181         TIME_WAIT   root       0            
  4. tcp        0      0 10.0.0.3:24623     10.0.1.77:2181         TIME_WAIT   root       0  

鍙戠幇user鏄痳oot銆備簬鏄互涓烘槸闈濲ava搴旂敤錛屽湪涓嶆柇鍦拌繛鎺ookeeper銆備簬鏄仠姝ava紼嬪簭錛屽彂鐜版病鏈塗IME_WAIT榪炴帴浜嗐?/span>
浣嗘槸紜鏄疛ava搴旂敤鐨勯棶棰橈紝浜庢槸鍐嶉噸鍚疛ava搴旂敤錛屼絾娌℃湁鍐嶅彂鐜癟IME_WAIT鎯呭喌銆傚緢璇″紓銆?/span>

闂涓嶈兘閲嶇幇浜嗭紝鐩稿綋鐨勮泲鐤箋傚拷鐒舵兂鍒扮嚎涓婄殑搴旂敤涔熻涔熸湁榪欎釜闂錛屼簬鏄埌綰夸笅zookeeper鏈嶅姟鍣ㄤ笂鏌ョ湅浜嗕笅錛屾灉鐒跺彂鐜版湁鍚屾牱鐨勯棶棰樸?/p>

鐢╰cpdump鎶撳寘鍜寃ireshark鍒嗘瀽

鍏堢敤tcpdump鏉ユ煡鐪嬩笅鍏蜂綋鐨勭綉緇滆繛鎺ワ紝鍙戠幇鐨勭‘鏄繛鎺ヨ繛涓婂啀鏂紑銆備簬鏄厛淇濆瓨鎴恈ap鏂囦歡錛屽啀鐢╳ireshark鏉ュ垎鏋愶細

  1. tcpdump -vv host 192.168.66.27 and port 2181 -w 2181.cap  
浣嗘槸涔熸病鏈夊彂鐜頒粈涔堟湁鐢ㄤ俊鎭紝鐨勭‘鏄疶CP榪炴帴榪炰笂錛屽啀FIN錛孉CK榪炴帴鏂紑銆?/span>

鏌ョ湅搴旂敤鏃ュ織錛屽彂鐜癟omcat webcontext娌℃湁姝e父鍚姩

娌″姙娉曚簡錛屾湁涓ょ鑰冭檻錛屼竴涓槸鐢╯trace錛屼簩鏄敤btrace銆備絾鏄痓trace濂戒箙娌$敤榪囦簡錛屼笉澶兂鍐嶅幓鐪嬩緥瀛愭枃。銆?/p>

榪樺ソ錛屽幓涓媌trace涔嬪悗錛屽厛鍘葷湅浜嗕笅搴旂敤鐨勬棩蹇楋紝鍙戠幇搴旂敤鎶ヤ簡涓浜汣lassLoader鐨勯敊璇細

  1. Nov 24, 2014 7:32:43 PM org.apache.catalina.loader.WebappClassLoader loadClass  
  2. INFO: Illegal access: this web application instance has been stopped already.  Could not load org.apache.zookeeper.ClientCnxnSocketNIO.  The eventual following stack trace is caused by an err  
  3. or thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.  
  4. java.lang.IllegalStateException  
  5.         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1564)  
  6.         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)  
  7.         at ch.qos.logback.classic.spi.PackagingDataCalculator.loadClass(PackagingDataCalculator.java:198)  
  8.         at ch.qos.logback.classic.spi.PackagingDataCalculator.bestEffortLoadClass(PackagingDataCalculator.java:226)  
  9.         at ch.qos.logback.classic.spi.PackagingDataCalculator.computeBySTEP(PackagingDataCalculator.java:132)  
  10.         at ch.qos.logback.classic.spi.PackagingDataCalculator.populateUncommonFrames(PackagingDataCalculator.java:107)  
  11.         at ch.qos.logback.classic.spi.PackagingDataCalculator.populateFrames(PackagingDataCalculator.java:99)  

鍥犱負鏈夌粡楠屼簡錛岄┈涓婄煡閬撹繖涓猅omcat鍥犱負鍏跺畠鍘熷洜webcontext瀹炲鍖栧け璐ラ鍑猴紝鐒跺悗鍚庨潰鐨勪竴浜涚嚎紼嬬戶緇窇鏃訛紝浼氭姏鍑篊lassLoader錛屾垨鑰匔lass not found鐨勫紓甯搞?/span>

浜庢槸鐚滄兂鍒板師鍥犱簡錛?/p>

Tomcat webcontext鍒濆鍖栧け璐ワ紝zookeeper鐨勯噸榪炵嚎紼嬭嚜鍔ㄤ笉鏂噸榪炪?/strong>

浣嗘槸涓轟粈涔堥噸鍚疶omcat涔嬪悗錛屾病鏈夐噸鐜癟IME_WAIT鐨勬儏鍐碉紵

鍐嶆姌鑵句簡涓嬶紝鍙戠幇鍙湁褰搝ookeeper閲嶅惎鍚庯紝搴旂敤鎵嶄細鍑虹幇澶ч噺鐨凾IME_WAIT榪炴帴銆傛姤鐨勬槸涓嬮潰榪欎釜寮傚父錛?/p>

  1. 2014-11-24 19:42:44,399 [Thread-3-SendThread(192.168.90.147:4181)] WARN  org.apache.zookeeper.ClientCnxn - Session 0x149c21809731325 for server 192.168.90.147/192.168.90.147:4181, unexpected error, closing socket connection and attempting reconnect  
  2. java.lang.NoClassDefFoundError: org/apache/zookeeper/proto/SetWatches  
  3.         at org.apache.zookeeper.ClientCnxn$SendThread.primeConnection(ClientCnxn.java:867) ~[zookeeper-3.4.5.jar:3.4.5-1392090]  
  4.         at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:352) ~[zookeeper-3.4.5.jar:3.4.5-1392090]  

榪欎釜寮傚父鐨勫師鍥狅紝鏄煇浜泎ookeeper鐨勭被娌℃湁鍔犺澆鍒般?/span>

鏈緇堝師鍥犲垎鏋?/h2>

姊崇悊涓嬫暣涓祦紼嬶細

  1. Tomcat鍚姩錛屽垵濮嬪寲webcontext錛?/li>
  2. 鍒濆鍖杝pring, spring鍒濆鏌愪簺浜沚ean錛岃繖浜沚ean鍖呮嫭浜唞ookeeper鐨勮繛鎺ョ浉鍏崇殑bean錛?/li>
  3. 榪欐椂zkClient錛堢嫭绔嬬嚎紼嬶級宸茬粡榪炴帴涓婃湇鍔″櫒浜嗭紝浣嗘槸classloader娌℃湁鍔犺澆鍒皁rg/apache/zookeeper/proto/SetWatches綾伙紱
  4. spring鍒濆鍖栧け璐ワ紝瀵艱嚧Tomcat webcontext鍒濆鍖栦篃澶辮觸錛屽簲鐢ㄥ湪鎸傝搗鐘舵侊紝浣唞kClient綰跨▼榪樻槸姝e父鐨勶紱
  5. zookeeper鏈嶅姟鍣ㄩ噸鍚紝zkClient寮濮嬮噸榪烇紝榪炴帴涓妟ookeeper鏈嶅姟鍣紱
  6. zkClient瑙﹀彂watch鐨勪竴浜涗唬鐮侊紝ClassLoader灝濊瘯鍔犺澆org/apache/zookeeper/proto/SetWatches綾伙紝浣嗘槸鍙戠幇鎵句笉鍒扮被錛屼簬鏄姏鍑哄紓甯革紱
  7. zkClient鎹曡幏鍒板紓甯革紝璁や負閲嶈繛澶辮觸錛宑lose鎺塩onnection錛屼紤鐪犲嚑縐掍箣鍚庯紝鍐嶆閲嶈繛錛?/li>

浜庢槸鍑虹幇浜唞kClient鍙嶅閲嶈瘯榪炴帴zookeeper鏈嶅姟鍣紝鑰屼笖閮芥槸縐掕繛縐掓柇鐨勬儏鍐點?/p>


鎬葷粨錛?/h2>

榪欐鎺掓煡鑺變簡涓嶅皯鏃墮棿錛屾湁涓師鍥犳槸寮濮嬫病鏈夊幓鏌ョ湅搴旂敤鐨勬棩蹇楋紝浠ヤ負搴旂敤鐨勬槸姝e父鐨勶紝鑰屼笖zookeeper.out鐨勮緭鍑烘棩蹇楀緢澶氾紝涔熸湁涓孌墊椂闂翠簡銆?/p>

榪樻湁綰夸笂鐨勫簲鐢ㄦ瘮杈冨潙鐖癸紝媧誨姩宸茬粡榪囨湡寰堜箙浜嗭紝浣嗘槸紼嬪簭榪樻槸綰夸笂璺戯紝涔熸病鏈変漢綆℃槸鍚﹀嚭闂浜嗐?/p>

鎵浠ワ紝涓昏綺懼姏鏀懼湪鍚勭緗戠粶榪炴帴鐘舵佺殑鑾峰彇涓娿傚鍘繪煡鐪嬪簲鐢ㄦ棩蹇楁瘮杈冩帓鏂ャ?/p>

榪樻湁涓涓師鍥犳槸錛岄棶棰樻瘮杈冭寮傦紝鏈夌偣闅鵑噸鐜幫紝褰撳彂鐜板彲浠ラ噸鐜版椂錛屽熀鏈凡緇忓彂鐜伴棶棰樻墍鍦ㄤ簡銆?/p>

鎺掓煡闂榪樻槸瑕佽愬績鏀墮泦淇℃伅錛屽啀鍒嗘瀽鍒ゆ柇銆?/p>

]]>鎻愬崌tomcat鏈嶅姟鍣ㄦц兘鐨勪竷鏉$粡楠?/title><link>http://www.tkk7.com/xiaomage234/archive/2014/07/29/416280.html</link><dc:creator>灝忛┈姝?/dc:creator><author>灝忛┈姝?/author><pubDate>Tue, 29 Jul 2014 02:31:00 GMT</pubDate><guid>http://www.tkk7.com/xiaomage234/archive/2014/07/29/416280.html</guid><wfw:comment>http://www.tkk7.com/xiaomage234/comments/416280.html</wfw:comment><comments>http://www.tkk7.com/xiaomage234/archive/2014/07/29/416280.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/xiaomage234/comments/commentRss/416280.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/xiaomage234/services/trackbacks/416280.html</trackback:ping><description><![CDATA[from:http://passover.blog.51cto.com/2431658/732629<br /><br /><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">鍦ㄧ嚎涓婄幆澧冧腑鎴戜滑鏄噰鐢ㄤ簡tomcat浣滀負Web鏈嶅姟鍣紝瀹冪殑澶勭悊鎬ц兘鐩存帴鍏崇郴鍒扮敤鎴蜂綋楠岋紝鍦ㄥ鉤鏃剁殑宸ヤ綔鍜屽涔犱腑錛屽綊綰沖嚭浠ヤ笅涓冪璋冧紭緇忛獙銆?/p><h1><span style="padding: 0px; margin: 0px; font-size: 22px;">1. 鏈嶅姟鍣ㄨ祫婧?/span></h1><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    鏈嶅姟鍣ㄦ墍鑳芥彁渚汣PU銆佸唴瀛樸佺‖鐩樼殑鎬ц兘瀵瑰鐞嗚兘鍔涙湁鍐沖畾鎬у獎鍝嶃?br style="padding: 0px; margin: 0px;" />    (1) 瀵逛簬楂樺茍鍙戞儏鍐典笅浼氭湁澶ч噺鐨勮繍綆楋紝閭d箞CPU鐨勯熷害浼氱洿鎺ュ獎鍝嶅埌澶勭悊閫熷害銆?br style="padding: 0px; margin: 0px;" />    (2) 鍐呭瓨鍦ㄥぇ閲忔暟鎹鐞嗙殑鎯呭喌涓嬶紝灝嗕細鏈夎緝澶х殑鍐呭瓨瀹歸噺闇姹傦紝鍙互鐢?Xmx -Xms -XX:MaxPermSize絳夊弬鏁板鍐呭瓨涓嶅悓鍔熻兘鍧楄繘琛屽垝鍒嗐傛垜浠箣鍓嶅氨閬囧埌榪囧唴瀛樺垎閰嶄笉瓚籌紝瀵艱嚧铏氭嫙鏈轟竴鐩村浜巉ull GC錛屼粠鑰屽鑷村鐞嗚兘鍔涗弗閲嶄笅闄嶃?br style="padding: 0px; margin: 0px;" />    (3) 紜洏涓昏闂灝辨槸璇誨啓鎬ц兘錛屽綋澶ч噺鏂囦歡榪涜璇誨啓鏃訛紝紓佺洏鏋佸鏄撴垚涓烘ц兘鐡墮銆傛渶濂界殑鍔炴硶榪樻槸鍒╃敤涓嬮潰鎻愬埌鐨勭紦瀛樸?/p><h1><span style="padding: 0px; margin: 0px; font-size: 22px;">2. 鍒╃敤緙撳瓨鍜屽帇緙?/span></h1><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    瀵逛簬闈欐侀〉闈㈡渶濂芥槸鑳藉緙撳瓨璧鋒潵錛岃繖鏍峰氨涓嶅繀姣忔浠庣鐩樹笂璇匯傝繖閲屾垜浠噰鐢ㄤ簡Nginx浣滀負緙撳瓨鏈嶅姟鍣紝灝嗗浘鐗囥乧ss銆乯s鏂囦歡閮借繘琛屼簡緙撳瓨錛屾湁鏁堢殑鍑忓皯浜嗗悗绔痶omcat鐨勮闂?/p><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    鍙﹀錛屼負浜嗚兘鍔犲揩緗戠粶浼犺緭閫熷害錛屽紑鍚痝zip鍘嬬緝涔熸槸蹇呬笉鍙皯鐨勩備絾鑰冭檻鍒皌omcat宸茬粡闇瑕佸鐞嗗緢澶氫笢瑗夸簡錛屾墍浠ユ妸榪欎釜鍘嬬緝鐨勫伐浣滃氨浜ょ粰鍓嶇鐨凬ginx鏉ュ畬鎴愩傚彲浠ュ弬鑰冧箣鍓嶅啓鐨勩?a target="_blank" style="padding: 0px; margin: 0px; color: #4b0002; text-decoration: none;">鍒╃敤nginx鍔犻焪eb璁塊棶</a>銆嬨?/p><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    闄や簡鏂囨湰鍙互鐢╣zip鍘嬬緝錛屽叾瀹炲緢澶氬浘鐗囦篃鍙互鐢ㄥ浘鍍忓鐞嗗伐鍏烽鍏堣繘琛屽帇緙╋紝鎵懼埌涓涓鉤琛$偣鍙互璁╃敾璐ㄦ崯澶卞緢灝忚屾枃浠跺彲浠ュ噺灝忓緢澶氥傛浘緇忔垜灝辮榪囦竴涓浘鐗囦粠300澶歬b鍘嬬緝鍒板嚑鍗乲b錛岃嚜宸卞嚑涔庣湅涓嶅嚭鏉ュ尯鍒?/p><h1><span style="padding: 0px; margin: 0px; font-size: 22px;">3. 閲囩敤闆嗙兢</span></h1><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    鍗曚釜鏈嶅姟鍣ㄦц兘鎬繪槸鏈夐檺鐨勶紝鏈濂界殑鍔炴硶鑷劧鏄疄鐜版í鍚戞墿灞曪紝閭d箞緇勫緩tomcat闆嗙兢鏄湁鏁堟彁鍗囨ц兘鐨勬墜孌點傛垜浠繕鏄噰鐢ㄤ簡Nginx鏉ヤ綔涓鴻姹傚垎嫻佺殑鏈嶅姟鍣紝鍚庣澶氫釜tomcat鍏變韓session鏉ュ崗鍚屽伐浣溿傚彲浠ュ弬鑰冧箣鍓嶅啓鐨勩?a target="_blank" style="padding: 0px; margin: 0px; color: #4b0002; text-decoration: none;">鍒╃敤nginx+tomcat+memcached緇勫緩web鏈嶅姟鍣ㄨ礋杞藉潎琛?/a>銆嬨?/p><h1><span style="padding: 0px; margin: 0px; font-size: 22px;">4. 浼樺寲tomcat鍙傛暟</span></h1><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    榪欓噷浠omcat7鐨勫弬鏁伴厤緗負渚嬶紝闇瑕佷慨鏀筩onf/server.xml鏂囦歡錛屼富瑕佹槸浼樺寲榪炴帴閰嶇疆錛屽叧闂鎴風dns鏌ヨ銆?/p><pre style="padding: 0px; margin-top: 0px; font-family: 'Courier New', monospace; font-size: 12px; overflow: auto; width: 712.796875px; color: #555555; background: #f7f7f7;"><ol style="padding: 5px 0px; margin: 0px; color: #5c5c5c; list-style-position: initial; list-style-image: initial; border-left-width: 3px; border-style: none none none solid; border-left-color: #146b00; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: #006699; font-weight: bold; background-color: inherit;"><</span><span style="padding: 0px; margin: 0px; border: none; color: #006699; font-weight: bold; background-color: inherit;">Connector</span> <span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">port</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">=</span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">"8080"</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">   </span></span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">           <span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">protocol</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">=</span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">"org.apache.coyote.http11.Http11NioProtocol"</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">  </span></span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">           <span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">connectionTimeout</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">=</span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">"20000"</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">  </span></span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">           <span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">redirectPort</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">=</span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">"8443"</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">   </span></span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">           <span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">maxThreads</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">=</span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">"500"</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">   </span></span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">           <span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">minSpareThreads</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">=</span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">"20"</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">  </span></span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">           <span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">acceptCount</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">=</span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">"100"</span> </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">           <span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">disableUploadTimeout</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">=</span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">"true"</span> </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">           <span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">enableLookups</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">=</span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">"false"</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">   </span></span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">           <span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">URIEncoding</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;">=</span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">"UTF-8"</span> <span style="padding: 0px; margin: 0px; border: none; color: #006699; font-weight: bold; background-color: inherit;">/></span> </span></li></ol></pre><h1><span style="padding: 0px; margin: 0px; font-size: 22px;">5. 鏀圭敤APR搴?/span></h1><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    tomcat榛樿閲囩敤鐨凚IO妯″瀷錛屽湪鍑犵櫨騫跺彂涓嬫ц兘浼氭湁寰堜弗閲嶇殑涓嬮檷銆倀omcat鑷甫榪樻湁NIO鐨勬ā鍨嬶紝鍙﹀涔熷彲浠ヨ皟鐢ˋPR鐨勫簱鏉ュ疄鐜版搷浣滅郴緇熺駭鍒帶鍒躲?/p><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    NIO妯″瀷鏄唴緗殑錛岃皟鐢ㄥ緢鏂逛究錛屽彧闇瑕佸皢涓婇潰閰嶇疆鏂囦歡涓璸rotocol淇敼鎴?span style="padding: 0px; margin: 0px; font-family: 瀹嬩綋;"><span style="padding: 0px; margin: 0px; font-size: 16px;"><span style="padding: 0px; margin: 0px; line-height: 18px;">org.apache.coyote.http11.Http11NioProtocol錛岄噸鍚嵆鍙敓鏁堛備笂闈㈤厤緗垜宸茬粡鏀硅繃浜嗭紝榛樿鐨勬槸HTTP/1.1銆?/span></span></span></p><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    APR鍒欓渶瑕佸畨瑁呯涓夋柟搴擄紝鍦ㄩ珮騫跺彂涓嬩細璁╂ц兘鏈夋槑鏄炬彁鍗囥傚叿浣撳畨瑁呭姙娉曞彲浠ュ弬鑰?a style="padding: 0px; margin: 0px; color: #4b0002; text-decoration: none;">http://www.cnblogs.com/huangjingzhou/articles/2097241.html</a>銆傚畨瑁呭畬鎴愬悗<span style="padding: 0px; margin: 0px; font-size: 16px; line-height: 18px; font-family: 瀹嬩綋;">閲嶅惎鍗沖彲鐢熸晥銆傚浣跨敤榛樿protocal灝辨槸apr錛屼絾鏈濂芥妸灝唒rotocol淇敼鎴?span style="padding: 0px; margin: 0px; font-size: 14px; line-height: 25px; font-family: Helvetica, Tahoma, Arial, sans-serif; background-color: #efefef;">org.apache.coyote.http11.Http11AprProtocol錛屼細鏇村姞鏄庣‘</span></span><span style="padding: 0px; margin: 0px; line-height: 25px; font-family: Helvetica, Tahoma, Arial, sans-serif; background-color: #efefef;">銆?/span></p><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    鍦ㄥ畼鏂規壘鍒頒竴涓〃鏍艱緇嗚鏄庝簡榪欎笁縐嶆柟寮忕殑鍖哄埆錛?/p><pre style="padding: 0px; margin-top: 0px; font-family: 'Courier New', monospace; font-size: 12px; overflow: auto; width: 712.796875px; color: #555555; background: #f7f7f7;"><ol style="padding: 5px 0px; margin: 0px; color: #5c5c5c; list-style-position: initial; list-style-image: initial; border-left-width: 3px; border-style: none none none solid; border-left-color: #146b00; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">                  Java Blocking Connector   Java Nio Blocking Connector   APR/native Connector </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">                             BIO                         NIO                       APR </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">Classname                AjpProtocol               AjpNioProtocol           AjpAprProtocol </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">Tomcat Version           3.x onwards                 7.x onwards              5.5.x onwards </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">Support Polling              NO                          YES                       YES </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">Polling Size                 N/A                   maxConnections             maxConnections </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">Read Request Headers      Blocking                  Sim Blocking                   Blocking </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">Read Request Body         Blocking                  Sim Blocking                   Blocking </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">Write Response            Blocking                  Sim Blocking                   Blocking </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">Wait for next Request     Blocking                  Non Blocking               Non Blocking </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">Max Connections        maxConnections              maxConnections             maxConnections </span></li></ol></pre><h1><span style="padding: 0px; margin: 0px; font-size: 22px;">6. 浼樺寲緗戠粶</span></h1><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    Joel涔熸槑紜彁鍑轟簡浼樺寲緗戝崱椹卞姩鍙互鏈夋晥鎻愬崌鎬ц兘錛岃繖涓浜庨泦緹ょ幆澧冨伐浣滅殑鏃跺欏挨涓洪噸瑕併傜敱浜庢垜浠噰鐢ㄤ簡linux鏈嶅姟鍣紝鎵浠ヤ紭鍖栧唴鏍稿弬鏁頒篃鏄竴涓潪甯擱噸瑕佺殑宸ヤ綔銆傜粰涓涓弬鑰冪殑浼樺寲鍙傛暟錛?/p><pre style="padding: 0px; margin-top: 0px; font-family: 'Courier New', monospace; font-size: 12px; overflow: auto; width: 712.796875px; color: #555555; background: #f7f7f7;"><ol style="padding: 5px 0px; margin: 0px; color: #5c5c5c; list-style-position: initial; list-style-image: initial; border-left-width: 3px; border-style: none none none solid; border-left-color: #146b00; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">1. 淇敼/etc/sysctl.cnf鏂囦歡錛屽湪鏈鍚庤拷鍔犲涓嬪唴瀹癸細 </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"> </li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.core.netdev_max_backlog</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">32768</span> </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.core.somaxconn</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">32768</span> </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.core.wmem_default</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">8388608</span> </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.core.rmem_default</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">8388608</span> </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.core.rmem_max</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">16777216</span> </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.core.wmem_max</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">16777216</span> </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.ip_local_port_range</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">1024</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> 65000 </span></span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.route.gc_timeout</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">100</span> </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.tcp_fin_timeout</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">30</span> </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.tcp_keepalive_time</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">1200</span> </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.tcp_timestamps</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">0</span> </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.tcp_synack_retries</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">2</span> </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.tcp_syn_retries</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">2</span> </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.tcp_tw_recycle</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">1</span> </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.tcp_tw_reuse</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">1</span> </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.tcp_mem</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">94500000</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> 915000000 927000000 </span></span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.tcp_max_orphans</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">3276800</span> </span></li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;"><span style="padding: 0px; margin: 0px; border: none; color: red; background-color: inherit;">net.ipv4.tcp_max_syn_backlog</span><span style="padding: 0px; margin: 0px; border: none; background-color: inherit;"> = </span><span style="padding: 0px; margin: 0px; border: none; color: blue; background-color: inherit;">65536</span> </span></li><li style="padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 20px; color: inherit; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none;"> </li><li style="margin-left: 20px; line-height: 1.3em; list-style: decimal-leading-zero outside; border: none; padding: 0px 3px 0px 10px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important;"><span style="padding: 0px; margin: 0px; border: none; color: black; background-color: inherit;">2. 淇濆瓨閫鍑猴紝鎵цsysctl -p鐢熸晥 </span></li></ol></pre><h1><span style="padding: 0px; margin: 0px; font-size: 22px;">7. 璁╂祴璇曡璇?/span></h1><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    浼樺寲緋葷粺鏈蹇岃鐨勫氨鏄彧璋冧紭涓嶆祴璇曪紝鏈夋椂涓嶉傚綋鐨勪紭鍖栧弽鑰屼細璁╂ц兘鏇翠綆銆備互涓婃墍鏈夌殑浼樺寲鏂規硶閮借鍦ㄦ湰鍦拌繘琛屾ц兘嫻嬭瘯榪囧悗鍐嶄笉鏂皟鏁村弬鏁幫紝榪欐牱鏈緇堟墠鑳借揪鍒版渶浣崇殑浼樺寲鏁堟灉銆?/p><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;"> </p><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">琛ュ厖Bio銆丯io銆丄pr妯″紡鐨勬祴璇曠粨鏋滐細</p><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">    瀵逛簬榪欏嚑縐嶆ā寮忥紝鎴戠敤ab鍛戒護妯℃嫙1000騫跺彂嫻嬭瘯10000璇嶏紝嫻嬭瘯緇撴灉姣旇緝鎰忓錛屼負浜嗙‘璁ょ粨鏋滐紝鎴戞瘡縐嶆柟寮忓弽澶嶆祴璇曚簡10澶氭錛屽茍涓斿湪涓や釜鏈嶅姟鍣ㄤ笂閮芥祴璇曚簡涓閬嶃傜粨鏋滃彂鐜癇io鍜孨io鎬ц兘宸埆闈炲父寰急錛岄毦鎬粯璁ゅ眳鐒惰繕鏄疊io銆備絾鏄噰鐢╝pr錛岃繛鎺ュ緩绔嬬殑閫熷害浼氭湁50%锝?00%鐨勬彁鍗囥傜洿鎺ヨ皟鐢ㄦ搷浣滅郴緇熷眰鏋滅劧紲為熷晩錛岃繖閲屽己鐑堟帹鑽恆pr鏂瑰紡錛?/p><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;"> </p><p style="padding: 0px; margin: 0px; clear: both; height: auto; overflow: hidden; color: #555555; font-family: 瀹嬩綋, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">鍙傝冭祫鏂欙細<br style="padding: 0px; margin: 0px;" /><a style="padding: 0px; margin: 0px; color: #4b0002; text-decoration: none;">http://16.199.geisvps.com/bbs/2836/24238.html</a></p><img src ="http://www.tkk7.com/xiaomage234/aggbug/416280.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/xiaomage234/" target="_blank">灝忛┈姝?/a> 2014-07-29 10:31 <a href="http://www.tkk7.com/xiaomage234/archive/2014/07/29/416280.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Tomcat7璋冭瘯榪愯鐜鎼緩涓庢簮浠g爜鍒嗘瀽鍏ラ棬http://www.tkk7.com/xiaomage234/archive/2013/08/21/403124.html灝忛┈姝?/dc:creator>灝忛┈姝?/author>Wed, 21 Aug 2013 04:30:00 GMThttp://www.tkk7.com/xiaomage234/archive/2013/08/21/403124.htmlhttp://www.tkk7.com/xiaomage234/comments/403124.htmlhttp://www.tkk7.com/xiaomage234/archive/2013/08/21/403124.html#Feedback0http://www.tkk7.com/xiaomage234/comments/commentRss/403124.htmlhttp://www.tkk7.com/xiaomage234/services/trackbacks/403124.html闃呰鍏ㄦ枃

]]>
涓嬭澆Tomcat婧愮爜錛屽茍浣滀負宸ョ▼瀵煎叆鍒癊clipse涓?http://www.tkk7.com/xiaomage234/archive/2013/08/21/403118.html灝忛┈姝?/dc:creator>灝忛┈姝?/author>Wed, 21 Aug 2013 02:41:00 GMThttp://www.tkk7.com/xiaomage234/archive/2013/08/21/403118.htmlhttp://www.tkk7.com/xiaomage234/comments/403118.htmlhttp://www.tkk7.com/xiaomage234/archive/2013/08/21/403118.html#Feedback0http://www.tkk7.com/xiaomage234/comments/commentRss/403118.htmlhttp://www.tkk7.com/xiaomage234/services/trackbacks/403118.html瀵煎叆Tomcat鐨勬簮浠g爜錛屽叾瀹炲緢綆鍗曪紝鍙槸濡傛灉娌℃湁鎵懼埌姝g‘鐨勬柟娉曪紝浣犱細嫻垂澶ч噺鐨勬椂闂達紝鎴戝氨鏄氮璐逛簡濂藉鏃墮棿鍦ㄩ厤緗紪璇戠幆澧冧笂銆傛渶姝g‘鐨勫姙娉曟槸鍒癟omcat鐨勫畼鏂圭綉鍧鍘繪壘鍒扮瓟妗堛?/div>
鍙互鍙傝冧笅杈圭殑榪炴帴錛岃繖涓槸鍏充簬Tomcat7鐨勩?/div>
http://tomcat.apache.org/tomcat-7.0-doc/building.html
1. 璁劇疆鐜
   1.1 JDK1.6 or above           JAVA_HOME
   1.2 Ant 1.8.1 or later        ANT_HOME
 
2. Check out the latest tomcat source code
svn --force export http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_11/ D:\Tomcat7\
涓婅竟鐨勫懡浠VN浼氭妸鏈鏂扮殑Tomcat7011鐨勬簮鐮佷笅杞藉埌浣犵殑紜洏D:\Tomcat7\ 涓?br />SVN 涓嬭澆鍦板潃 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
 
3. 涓篍clipse緙栬瘧宸ョ▼
   cd ${tomcat.source}
   ant ide-eclipse
  [娉╙ a. ${tomcat.source} 鏄綘涓嬭澆鐨勬簮鐮佸湪鏈哄櫒涓婄殑璺緞
       b. ant ide-eclipse: 榪欎釜榪囩▼浼氭瘮杈冩參錛屽洜涓轟細涓嬭澆涓浜涗緷璧栫殑絎笁鏂筳ar錛岃繖浜沯ar閮戒細鏀懼埌浣犲湪
          build.properties 涓緗殑 ${base.path} 鎵鎸囧悜鐨勮礬寰?/div>
4. 璁劇疆Eclipse 鐜 (Class-path Variables)
   璁劇疆TOMCAT_LIBS_BASE錛孉NT_HOME
   TOMCAT_LIBS_BASE 瑕佹寚鍚?nbsp;${base.path}
   ANT_HOME 鎸囧悜瀹夎ant鐨勭洰褰曞氨濂戒簡
5. 瀵煎叆宸ョ▼
   File -> Import and choose Existing Projects into Workspace
6. 緙栬瘧闂
   寰寰鎴戜滑鍦ㄨ繖鏃朵細閬囧埌涓浜涚紪璇戦敊璇紝榪欐槸鍥犱負鎴戜滑Eclipse涓璊RE鐜璁劇疆鐨勪笉姝g‘錛岄渶瑕佽皟鏁?/div>
   6.1 Java Compiler, 闇瑕?6.0 (1.6) 浠ヤ笂
       Window -> Preferences -> Java -> Complier -> JDK Compliance -> 6.0 (1.6)
   6.2 Default JRE, 闇瑕?1.6 浠ヤ笂
       Window -> Preferences -> Java -> Installed JREs -> jdk1.6
       褰撶劧錛岃繖涓篃鍙互鍦ㄥ伐紼嬩腑璁懼畾錛屽鏋滀綘榪樻湁鍏朵粬鐨勫伐紼嬪繀欏葷敤浠ュ墠鐨刯dk鐗堟湰鐨勮瘽銆?/div>
   6.3 Eclipse 鐗堟湰闂
       璋冩暣濂絁ava Compiler 鍜?JRE 鍚庯紝涓鑸彲浠ョ紪璇戦氳繃浜嗭紝浣嗘槸鎴戝氨閬囧埌浜咵clipse鐗堟湰闂錛屾繪湁涓涓?nbsp;
       compiler ArrayIndexOutofBoundaryException 鐨勯敊璇紝鍚庢潵鏇存柊浜嗕竴涓婨clipse,灝卞ソ浜嗭紝鎴戠敤鐨?/div>
       Eclipse 鐗堟湰鏄?.2鐨勩傛垜鍙堢敤浜咵clipse Galileo璇曠潃鎵撳紑宸ョ▼錛屽氨娌℃湁綾諱技鐨勯棶棰樸?/div>
7. 鏈鍛ㄥ埌鐨勬湇鍔?/div>
   鍒頒簡榪欓噷錛屾偍鐨勫伐紼嬪簲璇ュ氨緙栬瘧鎴愬姛浜嗐傝鎯蟲兂鎬庝箞run, debug TOMCAT浜嗭紝鎬庝箞璁劇疆鍟婏紵鍝堬紝鏈鍛ㄥ埌鐨勬湇鍔?/div>
   鏉ヤ簡錛屽湪 run(debug) ... -> Java Application 涓紝鎴戜滑浼氱湅鍒板凡緇忔湁涓や釜applications 浜嗭紝鍒嗗埆鍙仛
   start-tomcat, stop-tomcat.


]]> 主站蜘蛛池模板: 亚洲国产精品碰碰| 无遮挡国产高潮视频免费观看| 亚洲综合丁香婷婷六月香| 最新精品亚洲成a人在线观看| 黄色三级三级免费看| 亚洲视频小说图片| 国产亚洲精品a在线观看| 日韩特黄特色大片免费视频| 99久9在线|免费| 久久中文字幕免费视频| 国产免费一区二区三区免费视频 | 国内精品久久久久久久亚洲| 成年在线网站免费观看无广告| 亚洲暴爽av人人爽日日碰| 亚洲小说图片视频| 内射少妇36P亚洲区| 亚洲VA成无码人在线观看天堂| 91精品国产免费久久国语蜜臀| 99re6热视频精品免费观看| 在线观看亚洲免费视频| 亚洲无mate20pro麻豆| 91嫩草亚洲精品| 亚洲理论在线观看| 久久亚洲精品成人无码网站| 亚洲Av无码精品色午夜| 亚洲AV无码专区国产乱码电影 | 亚洲精品亚洲人成在线观看| 免费观看日本污污ww网站一区| 国产啪精品视频网站免费尤物| 亚洲日产2021三区| 亚洲黄色在线观看视频| 亚洲综合在线成人一区| 2022年亚洲午夜一区二区福利| 全部免费毛片免费播放| 国产一区二区三区在线观看免费 | 亚洲国产成人精品不卡青青草原| 91视频国产免费| 丁香花免费完整高清观看| 歪歪漫画在线观看官网免费阅读 | 久久久久久久亚洲Av无码| 久久久久亚洲精品无码蜜桃 |