{"id":54720,"date":"2025-08-13T10:20:03","date_gmt":"2025-08-13T02:20:03","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/54720.html"},"modified":"2025-08-13T10:20:03","modified_gmt":"2025-08-13T02:20:03","slug":"web%e5%ba%94%e7%94%a8%e6%9c%8d%e5%8a%a1%e5%99%a8tomcat","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/54720.html","title":{"rendered":"web\u5e94\u7528\u670d\u52a1\u5668tomcat"},"content":{"rendered":"<h2>tomcat\u529f\u80fd\u4ecb\u7ecd<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"300\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813021958-689bf64e4efd9.png\" width=\"575\" \/><\/p>\n<p>Tomcat \u670d\u52a1\u5668\u662f\u4e00\u4e2a\u514d\u8d39\u7684\u5f00\u653e\u6e90\u4ee3\u7801\u7684Web \u5e94\u7528\u670d\u52a1\u5668&#xff0c;\u5c5e\u4e8e\u8f7b\u91cf\u7ea7\u5e94\u7528\u670d\u52a1\u5668&#xff0c;\u5728\u4e2d\u5c0f\u578b\u7cfb\u7edf\u548c \u5e76\u53d1\u8bbf\u95ee\u7528\u6237\u4e0d\u662f\u5f88\u591a\u7684\u573a\u5408\u4e0b\u88ab\u666e\u904d\u4f7f\u7528&#xff0c;Tomcat \u5177\u6709\u5904\u7406HTML\u9875\u9762\u7684\u529f\u80fd&#xff0c;\u5b83\u8fd8\u662f\u4e00\u4e2aServlet\u548c JSP\u5bb9\u5668\u8d77\u59cb\u4e8eSUN \u516c\u53f8\u7684\u4e00\u4e2aServlet\u7684\u53c2\u8003\u5b9e\u73b0\u9879\u76ee Java Web Server&#xff0c;\u5f00\u53d1\u8005\u662f James Duncan Davidson&#xff0c; \u57281999\u5e74&#xff0c;\u5c06\u9879\u76ee\u8d21\u732e\u7ed9\u4e86apache\u8f6f\u4ef6\u57fa\u91d1\u4f1a&#xff08;ASF&#xff09;&#xff0c;\u548cASF\u73b0\u6709\u7684\u9879\u76ee JServ \u5408\u5e76&#xff0c;\u5e76\u5f00\u6e90\u6210\u4e3a\u9876\u7ea7 \u9879\u76ee<\/p>\n<p>Tomcat \u4ec5\u4ec5\u5b9e\u73b0\u4e86Java EE\u89c4\u8303\u4e2d\u4e0eServlet\u3001JSP\u76f8\u5173\u7684\u7c7b\u5e93&#xff0c;\u662fJavaEE\u4e0d\u5b8c\u6574\u5b9e\u73b0\u3002 1999\u5e74\u53d1\u5e03\u521d\u59cb\u7248\u672c\u662fTomcat 3.0&#xff0c;\u5b9e\u73b0\u4e86Servlet 2.2 \u548c JSP 1.1\u89c4\u8303\u3002 Tomcat 4.x\u53d1\u5e03\u65f6&#xff0c;\u5185\u5efa\u4e86Catalina&#xff08;Servlet\u5bb9\u5668&#xff09;\u548c Jasper&#xff08;JSP engine&#xff09;\u7b49 \u5f53\u524d Tomcat \u7684\u6b63\u5f0f\u7248\u672c\u5df2\u7ecf\u66f4\u65b0\u5230 9.0.x \u7248\u672c&#xff0c;\u4f46\u5f53\u524d\u4f01\u4e1a\u4e2d\u4e3b\u6d41\u7248\u672c\u4e3a 8.x<\/p>\n<\/p>\n<h2>\u5b89\u88c5tomcat<\/h2>\n<h5>1.\u5b89\u88c5java\u73af\u5883<\/h5>\n<p>#\u5b89\u88c5java\u73af\u5883<br \/>\n[root&#064;tomcat ~]# yum install java-1.8.0-openjdk.x86_64 -y<br \/>\n#\u67e5\u770bjava\u7248\u672c<br \/>\n[root&#064;tomcatA ~]# java -version<br \/>\nopenjdk version &#034;1.8.0_402&#034;<br \/>\nOpenJDK Runtime Environment (build 1.8.0_402-b06)<br \/>\nOpenJDK 64-Bit Server VM (build 25.402-b06, mixed mode)<br \/>\n#\u67e5\u770bjava\u7684\u73af\u5883\u76ee\u5f55<br \/>\n[root&#064;tomcatA ~]# which java<br \/>\n\/usr\/bin\/java<br \/>\n[root&#064;tomcatA ~]# ll \/usr\/bin\/java<br \/>\nlrwxrwxrwx 1 root root 22 Jul 30 10:41 \/usr\/bin\/java -&gt; \/etc\/alternatives\/java<br \/>\n#java\u7684\u8fd0\u884c\u73af\u5883<br \/>\n[root&#064;tomcatA ~]# cd \/etc\/alternatives\/jre<br \/>\n[root&#064;tomcatA jre]# ls<br \/>\nASSEMBLY_EXCEPTION bin lib LICENSE THIRD_PARTY_README<\/p>\n<h5>2.\u89e3\u538b\u5e76\u91cd\u547d\u540d<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"164\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813021958-689bf64e8e7f5.png\" width=\"1075\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"137\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813021958-689bf64ebdead.png\" width=\"1016\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"265\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813021958-689bf64ed7a6c.png\" width=\"1147\" \/><\/p>\n<p>\u542f\u52a8\u540e\u67e5\u770b\u7aef\u53e3<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"142\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813021959-689bf64f181e7.png\" width=\"1118\" \/><\/p>\n<p>\u6d4b\u8bd5&#xff1a;<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"626\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813021959-689bf64f37647.png\" width=\"1301\" \/><\/p>\n<\/p>\n<h2>tomcat\u6587\u4ef6\u7ec4\u6210<\/h2>\n<p>\u76ee\u5f55 \u00a0 \u8bf4\u660e<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nbin \u670d\u52a1\u542f\u52a8\u3001\u505c\u6b62\u7b49\u76f8\u5173\u7a0b\u5e8f\u548c\u6587\u4ef6<br \/>\nconf \u914d\u7f6e\u6587\u4ef6<br \/>\nlib \u00a0 \u5e93\u76ee\u5f55<br \/>\nlogs \u65e5\u5fd7\u76ee\u5f55<br \/>\nwebapps \u5e94\u7528\u7a0b\u5e8f&#xff0c;\u5e94\u7528\u90e8\u7f72\u76ee\u5f55&#xff0c;\u76f8\u5f53\u4e8enginx\u7684\u9ed8\u8ba4\u53d1\u5e03\u76ee\u5f55<br \/>\nwork jsp \u7f16\u8bd1\u540e\u7684\u7ed3\u679c\u6587\u4ef6&#xff0c;\u5efa\u8bae\u63d0\u524d\u9884\u70ed\u8bbf\u95ee<\/p>\n<h2>\u751f\u6210tomcat\u542f\u52a8\u6587\u4ef6<\/h2>\n<p>1.\u751f\u6210tomcat\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>[root&#064;tomcat ~]# vim \/usr\/local\/tomcat\/conf\/tomcat.conf<br \/>\nJAVA_HOME&#061;\/etc\/alternatives\/jre<\/p>\n<p>2.\u751f\u6210\u542f\u52a8\u6587\u4ef6<\/p>\n<p>[root&#064;tomcat ~]# vim \/lib\/systemd\/system\/tomcat.service<br \/>\n[Unit]<br \/>\nDescription&#061;Tomcat<br \/>\n#After&#061;syslog.target network.target remote-fs.target nss-lookup.target<br \/>\nAfter&#061;syslog.target network.target<br \/>\n[Service]<br \/>\nType&#061;forking<br \/>\nEnvironmentFile&#061;\/usr\/local\/tomcat\/conf\/tomcat.conf<br \/>\nExecStart&#061;\/usr\/local\/tomcat\/bin\/startup.sh<br \/>\nExecStop&#061;\/usr\/local\/tomcat\/bin\/shutdown.sh<br \/>\nPrivateTmp&#061;true<br \/>\nUser&#061;tomcat<br \/>\nGroup&#061;tomcat<br \/>\n[Install]<br \/>\nWantedBy&#061;multi-user.target<\/p>\n<p>3.\u751f\u6210tomcat\u7528\u6237\u5e76\u8bbe\u5b9a\u8f6f\u4ef6\u5b89\u88c5\u76ee\u5f55\u6743\u9650<\/p>\n<p>[root&#064;tomcatB bin]# useradd -s \/sbin\/nologin -M tomcat<br \/>\n[root&#064;tomcatB bin]# chown tomcat.tomcat \/usr\/local\/tomcat\/<\/p>\n<p>4.\u7528\u542f\u52a8\u811a\u672c\u5f00\u542f\u670d\u52a1<\/p>\n<p>systemctl enable tomcat &#8211;now<\/p>\n<\/p>\n<h2>\u7ed3\u5408\u53cd\u5411\u4ee3\u7406tomcat\u90e8\u7f72<\/h2>\n<p>\u7ed9\u9ed8\u8ba4\u53d1\u5e03\u9875\u9762\u4e00\u4e2a\u6d4b\u8bd5\u76ee\u5f55<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"83\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813021959-689bf64fa210c.png\" width=\"953\" \/><\/p>\n<p>dnf\u00a0 install\u00a0 nginx -y #\u5b89\u88c5nginx<\/p>\n<p>\u5728\u4e3b\u914d\u7f6e\u91cc\u5bfc\u5165\u6240\u6709\u5b50\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>vim \/var\/local\/nginx\/nginx.conf<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"118\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813021959-689bf64fc384d.png\" width=\"632\" \/><\/p>\n<\/p>\n<p>\u5728\u5b50\u914d\u7f6e\u6587\u4ef6\u5199\u5165<\/p>\n<p>vim \/var\/local\/nginx\/conf.d\/vhosts.conf<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"223\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813021959-689bf64fe0426.png\" width=\"839\" \/><\/p>\n<p>\u6d4b\u8bd5&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"263\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813022000-689bf650099ec.png\" width=\"644\" \/><\/p>\n<\/p>\n<h2>tomcat\u8d1f\u8f7d\u5747\u8861\u5b9e\u73b0<\/h2>\n<p>[root&#064;Nginx ~]# vim \/usr\/local\/nginx\/conf.d\/vhosts.conf<br \/>\nupstream tomcat {<br \/>\n \u00a0 #ip_bash;<br \/>\n \u00a0 #hash $cookie_JSESSIONID;<br \/>\n \u00a0 server 172.25.254.10:8080;<br \/>\n \u00a0 server 172.25.254.20:8080;<br \/>\n}<br \/>\nserver {<br \/>\n \u00a0 listen 80;<br \/>\n \u00a0 server_name lee.timinglee.org;<br \/>\n \u00a0 root \/webdataw\/nginx\/timinglee.org\/lee;<br \/>\n \u00a0 access_log \/var\/log\/nginx\/access.log;<br \/>\n \u00a0 error_log \/var\/log\/nginx\/error.log;<br \/>\n \u00a0 try_files $uri $uri.html $uri\/index.html \/error\/default.html;<br \/>\n \u00a0 location ~ \\\\.jsp$ {<br \/>\n \u00a0 \u00a0 \u00a0 proxy_pass http:\/\/tomcat;<br \/>\n \u00a0 }<br \/>\n}<\/p>\n<p>\u6d4b\u8bd5&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"249\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813022000-689bf6501d967.png\" width=\"602\" \/><\/p>\n<\/p>\n<h2>Memcached<\/h2>\n<p>Memcached \u53ea\u652f\u6301\u80fd\u5e8f\u5217\u5316\u7684\u6570\u636e\u7c7b\u578b&#xff0c;\u4e0d\u652f\u6301\u6301\u4e45\u5316&#xff0c;\u57fa\u4e8eKey-Value\u7684\u5185\u5b58\u7f13\u5b58\u7cfb\u7edfmemcached \u867d\u7136\u6ca1\u6709\u50cfredis\u6240\u5177\u5907\u7684\u6570\u636e\u6301\u4e45\u5316\u529f\u80fd&#xff0c;\u6bd4\u5982RDB\u548cAOF\u90fd\u6ca1\u6709&#xff0c;\u4f46\u662f\u53ef\u4ee5\u901a\u8fc7\u505a\u96c6\u7fa4\u540c\u6b65\u7684\u65b9\u5f0f&#xff0c; \u8ba9\u5404memcached\u670d\u52a1\u5668\u7684\u6570\u636e\u8fdb\u884c\u540c\u6b65&#xff0c;\u4ece\u800c\u5b9e\u73b0\u6570\u636e\u7684\u4e00\u81f4\u6027&#xff0c;\u5373\u4fdd\u8bc1\u5404memcached\u7684\u6570\u636e\u662f\u4e00\u6837 \u7684&#xff0c;\u5373\u4f7f\u6709\u4efb\u4f55\u4e00\u53f0 memcached \u53d1\u751f\u6545\u969c&#xff0c;\u53ea\u8981\u96c6\u7fa4\u4e2d\u6709\u4e00\u53f0 memcached \u53ef\u7528\u5c31\u4e0d\u4f1a\u51fa\u73b0\u6570\u636e\u4e22 \u5931&#xff0c;\u5f53\u5176\u4ed6memcached \u91cd\u65b0\u52a0\u5165\u5230\u96c6\u7fa4\u7684\u65f6\u5019,\u53ef\u4ee5\u81ea\u52a8\u4ece\u6709\u6570\u636e\u7684memcached \u5f53\u4e2d\u81ea\u52a8\u83b7\u53d6\u6570\u636e\u5e76 \u63d0\u4f9b\u670d\u52a1\u3002 Memcached \u501f\u52a9\u4e86\u64cd\u4f5c\u7cfb\u7edf\u7684 libevent \u5de5\u5177\u505a\u9ad8\u6548\u7684\u8bfb\u5199\u3002libevent\u662f\u4e2a\u7a0b\u5e8f\u5e93&#xff0c;\u5b83\u5c06Linux\u7684epoll\u3001 BSD\u7c7b\u64cd\u4f5c\u7cfb\u7edf\u7684kqueue\u7b49\u4e8b\u4ef6\u5904\u7406\u529f\u80fd\u5c01\u88c5\u6210\u7edf\u4e00\u7684\u63a5\u53e3\u3002\u5373\u4f7f\u5bf9\u670d\u52a1\u5668\u7684\u8fde\u63a5\u6570\u589e\u52a0&#xff0c;\u4e5f\u80fd\u53d1\u6325\u9ad8 \u6027\u80fd\u3002memcached\u4f7f\u7528\u8fd9\u4e2alibevent\u5e93&#xff0c;\u56e0\u6b64\u80fd\u5728Linux\u3001BSD\u3001Solaris\u7b49\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u53d1\u6325\u5176\u9ad8\u6027\u80fd Memcached \u652f\u6301\u6700\u5927\u7684\u5185\u5b58\u5b58\u50a8\u5bf9\u8c61\u4e3a1M&#xff0c;\u8d85\u8fc71M\u7684\u6570\u636e\u53ef\u4ee5\u4f7f\u7528\u5ba2\u6237\u7aef\u538b\u7f29\u6216\u62c6\u5206\u62a5\u5305\u653e\u5230\u591a\u4e2a key\u4e2d&#xff0c;\u6bd4\u8f83\u5927\u7684\u6570\u636e\u5728\u8fdb\u884c\u8bfb\u53d6\u7684\u65f6\u5019\u9700\u8981\u6d88\u8017\u7684\u65f6\u95f4\u6bd4\u8f83\u957f&#xff0c;memcached \u6700\u9002\u5408\u4fdd\u5b58\u7528\u6237\u7684 session\u5b9e\u73b0session\u5171\u4eab Memcached\u5b58\u50a8\u6570\u636e\u65f6, Memcached\u4f1a\u53bb\u7533\u8bf71MB\u7684\u5185\u5b58, \u628a\u8be5\u5757\u5185\u5b58\u79f0\u4e3a\u4e00\u4e2aslab, \u4e5f\u79f0\u4e3a\u4e00\u4e2apage Memcached \u652f\u6301\u591a\u79cd\u5f00\u53d1\u8bed\u8a00&#xff0c;\u5305\u62ec&#xff1a;JAVA,C,Python,PHP,C#,Ruby,Perl\u7b49<\/p>\n<\/p>\n<h5>memcached\u7684\u5b89\u88c5\u4e0e\u542f\u52a8<\/h5>\n<p>[root&#064;tomcat ~]# yum install memcached -y<br \/>\n[root&#064;tomcat ~]# vim \/etc\/sysconfig\/memcached<br \/>\nPORT&#061;&#034;11211&#034;<br \/>\nUSER&#061;&#034;memcached&#034;<br \/>\nMAXCONN&#061;&#034;1024&#034;<br \/>\nCACHESIZE&#061;&#034;64&#034;<br \/>\nOPTIONS&#061;&#034;-l 0.0.0.0,::1&#034;<br \/>\n[root&#064;tomcat ~]# systemctl enable &#8211;now memcached<br \/>\n[root&#064;tomcat ~]# netstat -antlupe | grep memcache<br \/>\ntcp \u00a0 \u00a0 \u00a0 0 \u00a0 \u00a0 0 0.0.0.0:11211 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0.0.0.0:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN \u00a0 \u00a0<br \/>\n980 \u00a0 \u00a0 \u00a0 97815 \u00a0 \u00a0 34711\/memcached<\/p>\n<h5>memcached\u64cd\u4f5c\u547d\u4ee4<\/h5>\n<p>\u4e94\u79cd\u57fa\u672c memcached \u547d\u4ee4\u6267\u884c\u6700\u7b80\u5355\u7684\u64cd\u4f5c\u3002\u8fd9\u4e9b\u547d\u4ee4\u548c\u64cd\u4f5c\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>set<\/li>\n<li>add<\/li>\n<li>replace<\/li>\n<li>get<\/li>\n<li>delete<\/li>\n<\/ul>\n<p>#\u53c2\u6570\u8bf4\u660e\u5982\u4e0b&#xff1a;<br \/>\ncommand set\/add\/replace<br \/>\nkey \u00a0 \u00a0 key \u7528\u4e8e\u67e5\u627e\u7f13\u5b58\u503c<br \/>\nflags \u00a0 \u00a0 \u53ef\u4ee5\u5305\u62ec\u952e\u503c\u5bf9\u7684\u6574\u578b\u53c2\u6570&#xff0c;\u5ba2\u6237\u673a\u4f7f\u7528\u5b83\u5b58\u50a8\u5173\u4e8e\u952e\u503c\u5bf9\u7684\u989d\u5916\u4fe1\u606f<br \/>\nexpiration time \u00a0 \u00a0 \u5728\u7f13\u5b58\u4e2d\u4fdd\u5b58\u952e\u503c\u5bf9\u7684\u65f6\u95f4\u957f\u5ea6&#xff08;\u4ee5\u79d2\u4e3a\u5355\u4f4d&#xff0c;0 \u8868\u793a\u6c38\u8fdc&#xff09;<br \/>\nbytes \u00a0 \u00a0 \u5728\u7f13\u5b58\u4e2d\u5b58\u50a8\u7684\u5b57\u8282\u6570<br \/>\nvalue \u00a0 \u00a0 \u5b58\u50a8\u7684\u503c&#xff08;\u59cb\u7ec8\u4f4d\u4e8e\u7b2c\u4e8c\u884c&#xff09;<br \/>\n#\u589e\u52a0key&#xff0c;\u8fc7\u671f\u65f6\u95f4\u4e3a\u79d2&#xff0c;bytes\u4e3a\u5b58\u50a8\u6570\u636e\u7684\u5b57\u8282\u6570<br \/>\nadd key flags exptime bytes \u00a0<\/p>\n<p>[root&#064;tomcat ~]# telnet localhost 11211<br \/>\nTrying ::1&#8230;<br \/>\nConnected to localhost.<br \/>\nEscape character is &#039;^]&#039;.<br \/>\n#\u589e\u52a0<br \/>\nadd leekey 0 60 4 #0 \u662f\u5426\u538b\u7f29 60 \u8fc7\u671f\u65f6\u95f4 4 \u5b57\u957f<br \/>\ntest<br \/>\nSTORED<br \/>\nadd leekey1 0 60 3<br \/>\nlee<br \/>\nSTORED<br \/>\n#\u67e5\u770b<br \/>\nget leekey<br \/>\nVALUE leekey 0 4<br \/>\ntest<br \/>\nget leekey1<br \/>\nVALUE leekey1 0 3<br \/>\nlee<br \/>\n#\u6539<br \/>\nset leekey 0 60 5<br \/>\ntest1<br \/>\nSTORED<br \/>\nget leekey<br \/>\nVALUE leekey 0 5<br \/>\ntest1<br \/>\nEND<br \/>\nadd leekey1 0 60 4<br \/>\ntest<br \/>\n#\u5220\u9664<br \/>\ndelete leekey<br \/>\nDELETED<br \/>\nget leekey<br \/>\nEND<\/p>\n<p>get leekey1<br \/>\nVALUE leekey1 0 3<br \/>\nlee<br \/>\n#\u6e05\u7a7a<br \/>\nflush_all<br \/>\nOK<br \/>\nget leekey1<br \/>\nEND<\/p>\n<h2>msm<\/h2>\n<p>msm&#xff08;memcached session manager&#xff09;\u63d0\u4f9b\u5c06Tomcat\u7684session\u4fdd\u6301\u5230memcached\u53ef\u4ee5\u5b9e\u73b0\u9ad8\u53ef\u7528\u3002 \u9879\u76ee\u65e9\u671f\u6258\u7ba1\u5728google code,\u76ee\u524d\u5728Github<\/p>\n<p>rpm -qa\u00a0 | grep memcached<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"587\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813022000-689bf6503177f.png\" width=\"878\" \/><\/p>\n<p>\u67e5\u770btomcat\u63d2\u4ef6\u5b58\u50a8\u4f4d\u7f6e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"395\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813022000-689bf6506773e.png\" width=\"793\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"343\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813022000-689bf65092d4b.png\" width=\"876\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"405\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813022000-689bf650befa0.png\" width=\"933\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"345\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813022000-689bf650e73d4.png\" width=\"907\" \/><\/p>\n<p>systemctl\u00a0 restart tomcat # \u91cd\u542ftomcat<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"187\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813022001-689bf6511e9f9.png\" width=\"924\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"550\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813022001-689bf65137e69.png\" width=\"1245\" \/><\/p>\n<p>failoverNodes&#xff1a;\u5f53\u4e00\u4e2a\u670d\u52a1\u5668\u7684tomcat\u51fa\u6545\u969c\u65f6&#xff0c;\u53e6\u4e00\u53f0\u4f1a\u8981\u627e\u81ea\u5df1\u7684memcached\u7684&#xff0c;\u56e0\u4e3a\u81ea\u5df1\u7684\u91cc\u9762\u4e5f\u662f\u6709\u5bf9\u7aef\u7684\u6570\u636e\u7684<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"546\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813022001-689bf6517d4af.png\" width=\"1277\" \/><\/p>\n<p>\u518d\u91cd\u542f\u670d\u52a1<\/p>\n<p>systemctl restart tomcat<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"288\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813022001-689bf651e0d47.png\" width=\"620\" \/><\/p>\n<\/p>\n<p>20\u4e3b\u673a\u7684tomcat\u6302\u4e86<\/p>\n<p>systemctl stop tomcat.service<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"176\" src=\"2025-08-13lnwequapudx.png\" width=\"384\" \/><\/p>\n<p>\u8fd9\u91cc\u4f1a\u6709\u4e4b\u524d\u6570\u636e\u7684\u539f\u56e0\u662f&#xff0c;20\u5f8010\u7684memcached\u91cc\u5b58\u7684\u6570\u636e&#xff0c;20\u6302\u4e86&#xff0c;10\u4f1a\u5728memcached\u91cc\u8bfb\u53d6\u6570\u636e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"335\" src=\"2025-08-13340fhbrztyz.png\" width=\"692\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb724\u6b21\uff0c\u70b9\u8d5e22\u6b21\uff0c\u6536\u85cf16\u6b21\u3002Tomcat \u670d\u52a1\u5668\u662f\u4e00\u4e2a\u514d\u8d39\u7684\u5f00\u653e\u6e90\u4ee3\u7801\u7684Web \u5e94\u7528\u670d\u52a1\u5668\uff0c\u5c5e\u4e8e\u8f7b\u91cf\u7ea7\u5e94\u7528\u670d\u52a1\u5668\uff0c\u5728\u4e2d\u5c0f\u578b\u7cfb\u7edf\u548c \u5e76\u53d1\u8bbf\u95ee\u7528\u6237\u4e0d\u662f\u5f88\u591a\u7684\u573a\u5408\u4e0b\u88ab\u666e\u904d\u4f7f\u7528\uff0cTomcat \u5177\u6709\u5904\u7406HTML\u9875\u9762\u7684\u529f\u80fd\uff0c\u5b83\u8fd8\u662f\u4e00\u4e2aServlet\u548c JSP\u5bb9\u5668\u8d77\u59cb\u4e8eSUN \u516c\u53f8\u7684\u4e00\u4e2aServlet\u7684\u53c2\u8003\u5b9e\u73b0\u9879\u76ee Java Web Server\uff0c\u5f00\u53d1\u8005\u662f James Duncan Davidson\uff0c \u57281999\u5e74\uff0c\u5c06\u9879\u76ee\u8d21\u732e\u7ed9\u4e86apache\u8f6f\u4ef6\u57fa\u91d1\u4f1a\uff08ASF\uff09\uff0c\u548cASF\u73b0\u6709\u7684\u9879\u76ee JServ \u5408\u5e76\uff0c\u5e76\u5f00\u6e90\u6210\u4e3a\u9876\u7ea7 \u9879\u76ee\u3002<\/p>\n","protected":false},"author":2,"featured_media":54700,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,223,87],"topic":[],"class_list":["post-54720","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-tomcat","tag-87"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>web\u5e94\u7528\u670d\u52a1\u5668tomcat - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/54720.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"web\u5e94\u7528\u670d\u52a1\u5668tomcat - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb724\u6b21\uff0c\u70b9\u8d5e22\u6b21\uff0c\u6536\u85cf16\u6b21\u3002Tomcat \u670d\u52a1\u5668\u662f\u4e00\u4e2a\u514d\u8d39\u7684\u5f00\u653e\u6e90\u4ee3\u7801\u7684Web \u5e94\u7528\u670d\u52a1\u5668\uff0c\u5c5e\u4e8e\u8f7b\u91cf\u7ea7\u5e94\u7528\u670d\u52a1\u5668\uff0c\u5728\u4e2d\u5c0f\u578b\u7cfb\u7edf\u548c \u5e76\u53d1\u8bbf\u95ee\u7528\u6237\u4e0d\u662f\u5f88\u591a\u7684\u573a\u5408\u4e0b\u88ab\u666e\u904d\u4f7f\u7528\uff0cTomcat \u5177\u6709\u5904\u7406HTML\u9875\u9762\u7684\u529f\u80fd\uff0c\u5b83\u8fd8\u662f\u4e00\u4e2aServlet\u548c JSP\u5bb9\u5668\u8d77\u59cb\u4e8eSUN \u516c\u53f8\u7684\u4e00\u4e2aServlet\u7684\u53c2\u8003\u5b9e\u73b0\u9879\u76ee Java Web Server\uff0c\u5f00\u53d1\u8005\u662f James Duncan Davidson\uff0c \u57281999\u5e74\uff0c\u5c06\u9879\u76ee\u8d21\u732e\u7ed9\u4e86apache\u8f6f\u4ef6\u57fa\u91d1\u4f1a\uff08ASF\uff09\uff0c\u548cASF\u73b0\u6709\u7684\u9879\u76ee JServ \u5408\u5e76\uff0c\u5e76\u5f00\u6e90\u6210\u4e3a\u9876\u7ea7 \u9879\u76ee\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/54720.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-13T02:20:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813021958-689bf64e4efd9.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54720.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/54720.html\",\"name\":\"web\u5e94\u7528\u670d\u52a1\u5668tomcat - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-13T02:20:03+00:00\",\"dateModified\":\"2025-08-13T02:20:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/54720.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/54720.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54720.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"web\u5e94\u7528\u670d\u52a1\u5668tomcat\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"web\u5e94\u7528\u670d\u52a1\u5668tomcat - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/54720.html","og_locale":"zh_CN","og_type":"article","og_title":"web\u5e94\u7528\u670d\u52a1\u5668tomcat - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb724\u6b21\uff0c\u70b9\u8d5e22\u6b21\uff0c\u6536\u85cf16\u6b21\u3002Tomcat \u670d\u52a1\u5668\u662f\u4e00\u4e2a\u514d\u8d39\u7684\u5f00\u653e\u6e90\u4ee3\u7801\u7684Web \u5e94\u7528\u670d\u52a1\u5668\uff0c\u5c5e\u4e8e\u8f7b\u91cf\u7ea7\u5e94\u7528\u670d\u52a1\u5668\uff0c\u5728\u4e2d\u5c0f\u578b\u7cfb\u7edf\u548c \u5e76\u53d1\u8bbf\u95ee\u7528\u6237\u4e0d\u662f\u5f88\u591a\u7684\u573a\u5408\u4e0b\u88ab\u666e\u904d\u4f7f\u7528\uff0cTomcat \u5177\u6709\u5904\u7406HTML\u9875\u9762\u7684\u529f\u80fd\uff0c\u5b83\u8fd8\u662f\u4e00\u4e2aServlet\u548c JSP\u5bb9\u5668\u8d77\u59cb\u4e8eSUN \u516c\u53f8\u7684\u4e00\u4e2aServlet\u7684\u53c2\u8003\u5b9e\u73b0\u9879\u76ee Java Web Server\uff0c\u5f00\u53d1\u8005\u662f James Duncan Davidson\uff0c \u57281999\u5e74\uff0c\u5c06\u9879\u76ee\u8d21\u732e\u7ed9\u4e86apache\u8f6f\u4ef6\u57fa\u91d1\u4f1a\uff08ASF\uff09\uff0c\u548cASF\u73b0\u6709\u7684\u9879\u76ee JServ \u5408\u5e76\uff0c\u5e76\u5f00\u6e90\u6210\u4e3a\u9876\u7ea7 \u9879\u76ee\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/54720.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-13T02:20:03+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813021958-689bf64e4efd9.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/54720.html","url":"https:\/\/www.wsisp.com\/helps\/54720.html","name":"web\u5e94\u7528\u670d\u52a1\u5668tomcat - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-13T02:20:03+00:00","dateModified":"2025-08-13T02:20:03+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/54720.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/54720.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/54720.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"web\u5e94\u7528\u670d\u52a1\u5668tomcat"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/54720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=54720"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/54720\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/54700"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=54720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=54720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=54720"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=54720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}