{"id":104555,"date":"2026-09-12T18:25:16","date_gmt":"2026-09-12T10:25:16","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/104555.html"},"modified":"2026-09-12T18:25:16","modified_gmt":"2026-09-12T10:25:16","slug":"springboot%e6%95%b0%e5%8d%81jar%e5%8c%85%e6%89%b9%e9%87%8f%e7%94%9f%e4%ba%a7%e9%83%a8%e7%bd%b2%e8%90%bd%e5%9c%b0%e5%ae%9e%e6%96%bd%e6%96%b9%e6%a1%88%ef%bc%88shellsystemd%e5%ae%8c%e6%95%b4%e7%89%88","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/104555.html","title":{"rendered":"SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848\uff08Shell+Systemd\u5b8c\u6574\u7248\uff09"},"content":{"rendered":"<p style=\"margin-left:.0001pt;margin-right:0;text-align:justify\">SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848&#xff08;Shell&#043;Systemd\u5b8c\u6574\u7248&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4e00\u3001\u65b9\u6848\u6574\u4f53\u6982\u8ff0<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">1.1 \u9002\u7528\u573a\u666f<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u672c\u5730\u5b58\u5728\u6570\u5341\u4e2a\u72ec\u7acbSpringBoot Jar\u5305&#xff0c;\u5355\/\u5c11\u91cf\u751f\u4ea7\u670d\u52a1\u5668\u90e8\u7f72&#xff0c;\u65e0\u9700\u5bb9\u5668\u5316\u3001\u4f4e\u6210\u672c\u3001\u5feb\u901f\u843d\u5730&#xff0c;\u652f\u6301\u6279\u91cf\u66f4\u65b0\u3001\u6279\u91cf\u542f\u505c\u3001\u7248\u672c\u5907\u4efd\u56de\u6eda\u3001\u5f00\u673a\u81ea\u542f\u3001\u6545\u969c\u81ea\u52a8\u91cd\u542f&#xff0c;\u9002\u914d\u4e2d\u5c0f\u578b\u9879\u76ee\u8fd0\u7ef4\u573a\u666f\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">1.2 \u65b9\u6848\u6838\u5fc3\u4f18\u52bf<\/p>\n<ul>\n<li style=\"text-align:left\">\u65e0\u9700\u4fee\u6539\u4e1a\u52a1\u4ee3\u7801&#xff0c;\u539f\u6709Jar\u5305\u76f4\u63a5\u590d\u7528<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">\u7eafShell\u811a\u672c&#043;Systemd&#xff0c;\u65e0\u4e2d\u95f4\u4ef6\u4f9d\u8d56&#xff0c;\u670d\u52a1\u5668\u8d44\u6e90\u5360\u7528\u6781\u4f4e<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">\u6807\u51c6\u5316\u76ee\u5f55\u3001\u6807\u51c6\u5316\u542f\u505c\u3001\u6807\u51c6\u5316\u5907\u4efd&#xff0c;\u675c\u7edd\u90e8\u7f72\u6df7\u4e71<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">\u652f\u6301\u6279\u91cf\u5168\u91cf\u90e8\u7f72\u3001\u5355\u4e2a\u670d\u52a1\u66f4\u65b0\u3001\u4e00\u952e\u56de\u6eda\u7248\u672c<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">\u670d\u52a1\u5d29\u6e83\u81ea\u52a8\u91cd\u542f\u3001\u670d\u52a1\u5668\u5f00\u673a\u81ea\u542f&#xff0c;\u6ee1\u8db3\u751f\u4ea7\u57fa\u7840\u9ad8\u53ef\u7528<\/li>\n<\/ul>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">1.3 \u73af\u5883\u524d\u7f6e\u8981\u6c42<\/p>\n<ul>\n<li style=\"text-align:left\">\u751f\u4ea7\u670d\u52a1\u5668&#xff1a;CentOS 7&#043;\/Ubuntu 18.04&#043;<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">\u7edf\u4e00JDK\u73af\u5883&#xff1a;JDK8\/JDK11&#xff08;\u5168\u5458\u7edf\u4e00\u7248\u672c&#xff0c;\u672c\u673a\u4e0e\u751f\u4ea7\u4e00\u81f4&#xff09;<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">\u670d\u52a1\u5668\u53ef\u8054\u7f51\u3001\u652f\u6301SSH\u8fdc\u7a0b\u8fde\u63a5\u3001\u5f00\u542fSFTP\u6587\u4ef6\u4e0a\u4f20<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">\u62e5\u6709\u670d\u52a1\u5668root\u6216sudo\u6743\u9650<\/li>\n<\/ul>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4e8c\u3001\u7b2c\u4e00\u6b65&#xff1a;\u751f\u4ea7\u670d\u52a1\u5668\u73af\u5883\u521d\u59cb\u5316&#xff08;\u5fc5\u505a&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">2.1 \u5b89\u88c5\u5e76\u914d\u7f6e\u7edf\u4e00JDK<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u5168\u7a0b\u4f7f\u7528\u7edf\u4e00JDK\u7248\u672c&#xff0c;\u907f\u514d\u73af\u5883\u4e0d\u4e00\u81f4\u5bfc\u81f4\u542f\u52a8\u5f02\u5e38&#xff0c;\u4ee5JDK11\u4e3a\u4f8b&#xff1a;<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n# CentOS\u5b89\u88c5JDK11<br \/>\nyum install -y java-11-openjdk-devel<br \/>\n# Ubuntu\u5b89\u88c5JDK11<br \/>\napt install -y openjdk-11-jdk<\/p>\n<p># \u9a8c\u8bc1\u7248\u672c<br \/>\njava -version<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">2.2 \u521b\u5efa\u4e13\u7528\u8fd0\u7ef4\u7528\u6237&#xff08;\u7981\u6b62root\u8fd0\u884c\u4e1a\u52a1&#xff09;<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n# \u521b\u5efa\u666e\u901a\u7528\u6237app&#xff0c;\u7edf\u4e00\u8fd0\u884c\u4e1a\u52a1<br \/>\nuseradd app<br \/>\n# \u8bbe\u7f6e\u5bc6\u7801&#xff08;\u81ea\u5b9a\u4e49&#xff09;<br \/>\npasswd app<br \/>\n# \u8d4b\u4e88app\u7528\u6237sudo\u6743\u9650&#xff08;\u65b9\u4fbf\u8fd0\u7ef4\u64cd\u4f5c&#xff09;<br \/>\nusermod -aG wheel app<\/p>\n<p># \u5207\u6362\u5230app\u7528\u6237&#xff0c;\u540e\u7eed\u6240\u6709\u90e8\u7f72\u64cd\u4f5c\u5747\u4f7f\u7528\u8be5\u7528\u6237<br \/>\nsu &#8211; app<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">2.3 \u642d\u5efa\u7edf\u4e00\u6807\u51c6\u5316\u76ee\u5f55\u7ed3\u6784<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u6240\u6709\u670d\u52a1\u7edf\u4e00\u76ee\u5f55\u89c4\u8303&#xff0c;\u675c\u7edd\u6563\u4e71\u90e8\u7f72&#xff0c;\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4e00\u952e\u521b\u5efa\u6240\u6709\u76ee\u5f55&#xff1a;<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n# \u57fa\u7840\u6839\u76ee\u5f55<br \/>\nmkdir -p \/opt\/app\/{bin,apps,deploy,backup,logs,temp}<\/p>\n<p># \u76ee\u5f55\u8bf4\u660e<br \/>\n# \/opt\/app\/bin \u00a0\u00a0\u00a0\u00a0\u00a0&#xff1a;\u6240\u6709\u8fd0\u7ef4\u811a\u672c\u5b58\u653e\u76ee\u5f55<br \/>\n# \/opt\/app\/apps \u00a0\u00a0\u00a0\u00a0&#xff1a;\u6240\u6709\u670d\u52a1Jar\u3001\u914d\u7f6e\u6587\u4ef6\u8fd0\u884c\u76ee\u5f55<br \/>\n# \/opt\/app\/deploy \u00a0\u00a0&#xff1a;\u672c\u5730\u4e0a\u4f20\u65b0\u5305\u7684\u4e34\u65f6\u90e8\u7f72\u76ee\u5f55<br \/>\n# \/opt\/app\/backup \u00a0\u00a0&#xff1a;\u5386\u53f2\u7248\u672cJar\u5907\u4efd\u76ee\u5f55&#xff08;\u7528\u4e8e\u56de\u6eda&#xff09;<br \/>\n# \/opt\/app\/logs \u00a0\u00a0\u00a0\u00a0&#xff1a;\u5168\u5c40\u65e5\u5fd7\u6c47\u603b\u76ee\u5f55<br \/>\n# \/opt\/app\/temp \u00a0\u00a0\u00a0\u00a0&#xff1a;\u4e34\u65f6\u6587\u4ef6\u76ee\u5f55<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4e09\u3001\u7b2c\u4e8c\u6b65&#xff1a;\u672c\u5730\u6587\u4ef6\u6807\u51c6\u5316\u6574\u7406&#xff08;\u6838\u5fc3\u524d\u7f6e&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u5c06\u672c\u5730\u51e0\u5341\u4e2aJar\u5305\u7edf\u4e00\u89c4\u6574&#xff0c;\u9002\u914d\u6279\u91cf\u90e8\u7f72\u89c4\u5219&#xff0c;\u907f\u514d\u90e8\u7f72\u51fa\u9519\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">3.1 \u7edf\u4e00\u670d\u52a1\u547d\u540d\u89c4\u8303<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u6240\u6709\u670d\u52a1\u540d\u79f0\u7edf\u4e00\u5c0f\u5199\u3001\u4e2d\u5212\u7ebf\u5206\u9694&#xff0c;\u65e0\u7279\u6b8a\u5b57\u7b26&#xff0c;\u793a\u4f8b&#xff1a;user-service\u3001order-service\u3001gateway-service\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">3.2 \u672c\u5730\u6587\u4ef6\u5939\u89c4\u6574\u7ed3\u6784<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u672c\u5730\u65b0\u5efa\u603b\u6587\u4ef6\u5939 local-deploy&#xff0c;\u5185\u90e8\u6bcf\u4e2a\u670d\u52a1\u72ec\u7acb\u5b50\u6587\u4ef6\u5939&#xff0c;\u7ed3\u6784\u5982\u4e0b&#xff1a;<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">Plain Text<\/span><br \/>\nlocal-deploy\/<br \/>\n\u251c\u2500\u2500 user-service\/<br \/>\n\u2502 \u00a0\u00a0\u251c\u2500\u2500 user-service.jar \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0# \u4e1a\u52a1jar\u5305<br \/>\n\u2502 \u00a0\u00a0\u2514\u2500\u2500 application-prod.yml \u00a0\u00a0\u00a0# \u751f\u4ea7\u73af\u5883\u914d\u7f6e\u6587\u4ef6&#xff08;\u5916\u7f6e&#xff0c;\u4e0d\u6253\u5305\u8fdbjar&#xff09;<br \/>\n\u251c\u2500\u2500 order-service\/<br \/>\n\u2502 \u00a0\u00a0\u251c\u2500\u2500 order-service.jar<br \/>\n\u2502 \u00a0\u00a0\u2514\u2500\u2500 application-prod.yml<br \/>\n\u251c\u2500\u2500 goods-service\/<br \/>\n\u2514\u2500\u2500 &#8230;&#xff08;\u5269\u4f59\u6240\u6709\u670d\u52a1&#xff09;<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">3.3 \u914d\u7f6e\u6587\u4ef6\u5f3a\u5236\u5916\u7f6e<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u6240\u6709\u670d\u52a1\u7684\u751f\u4ea7\u914d\u7f6e<span style=\"background-color:#eff0f1\">application-prod.yml<\/span>\u5168\u90e8\u5916\u7f6e&#xff0c;\u4e0d\u6253\u5165Jar\u5305&#xff0c;\u540e\u7eed\u6539\u914d\u7f6e\u65e0\u9700\u91cd\u65b0\u6253\u5305&#xff0c;\u76f4\u63a5\u4fee\u6539\u670d\u52a1\u5668\u6587\u4ef6\u5373\u53ef&#xff0c;\u964d\u4f4e\u8fd0\u7ef4\u6210\u672c\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u56db\u3001\u7b2c\u4e09\u6b65&#xff1a;\u670d\u52a1\u5668\u6279\u91cf\u8fd0\u7ef4\u811a\u672c\u90e8\u7f72&#xff08;\u6838\u5fc3&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u5728\u670d\u52a1\u5668<span style=\"background-color:#eff0f1\">\/opt\/app\/bin<\/span>\u76ee\u5f55\u4e0b\u521b\u5efa4\u4e2a\u6838\u5fc3\u811a\u672c&#xff0c;\u8986\u76d6\u90e8\u7f72\u3001\u542f\u505c\u3001\u56de\u6eda\u3001\u72b6\u6001\u68c0\u67e5\u5168\u80fd\u529b\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">4.1 \u811a\u672c1&#xff1a;\u6279\u91cf\u90e8\u7f72\u66f4\u65b0\u811a\u672c deploy.sh<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u529f\u80fd&#xff1a;\u81ea\u52a8\u5907\u4efd\u65e7\u5305\u3001\u66ff\u6362\u65b0Jar\u548c\u914d\u7f6e\u3001\u4fdd\u7559\u5386\u53f2\u7248\u672c\u3001\u907f\u514d\u4e22\u5305<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n#!\/bin\/bash<br \/>\n# \u6279\u91cf\u90e8\u7f72SpringBoot\u670d\u52a1\u811a\u672c<br \/>\nAPP_BASE&#061;&#034;\/opt\/app&#034;<br \/>\nDEPLOY_DIR&#061;&#034;${APP_BASE}\/deploy&#034;<br \/>\nBACKUP_DIR&#061;&#034;${APP_BASE}\/backup&#034;<br \/>\nTIMESTAMP&#061;$(date &#043;%Y%m%d_%H%M%S)<\/p>\n<p>echo &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;<br \/>\necho &#034;\u5f00\u59cb\u6279\u91cf\u90e8\u7f72&#xff0c;\u90e8\u7f72\u65f6\u95f4\u6233&#xff1a;${TIMESTAMP}&#034;<br \/>\necho &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;<\/p>\n<p># \u904d\u5386\u90e8\u7f72\u76ee\u5f55\u4e0b\u6240\u6709\u670d\u52a1\u6587\u4ef6\u5939<br \/>\nfor SERVICE_DIR in ${DEPLOY_DIR}\/*\/; do<br \/>\n\u00a0\u00a0\u00a0\u00a0# \u622a\u53d6\u670d\u52a1\u540d<br \/>\n\u00a0\u00a0\u00a0\u00a0SERVICE_NAME&#061;$(basename ${SERVICE_DIR%\/})<br \/>\n\u00a0\u00a0\u00a0\u00a0TARGET_DIR&#061;&#034;${APP_BASE}\/apps\/${SERVICE_NAME}&#034;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0# \u8df3\u8fc7\u7a7a\u76ee\u5f55<br \/>\n\u00a0\u00a0\u00a0\u00a0if [ ! -d &#034;${SERVICE_DIR}&#034; ]; then<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0continue<br \/>\n\u00a0\u00a0\u00a0\u00a0fi<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0echo &#034;\u3010\u6b63\u5728\u90e8\u7f72\u3011${SERVICE_NAME}&#034;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0# 1. \u521b\u5efa\u670d\u52a1\u8fd0\u884c\u76ee\u5f55<br \/>\n\u00a0\u00a0\u00a0\u00a0mkdir -p ${TARGET_DIR}<br \/>\n\u00a0\u00a0\u00a0\u00a0# 2. \u5907\u4efd\u65e7\u7248\u672cJar&#xff08;\u5b58\u5728\u624d\u5907\u4efd&#xff09;<br \/>\n\u00a0\u00a0\u00a0\u00a0if [ -f &#034;${TARGET_DIR}\/${SERVICE_NAME}.jar&#034; ]; then<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0mkdir -p ${BACKUP_DIR}\/${SERVICE_NAME}<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0cp ${TARGET_DIR}\/${SERVICE_NAME}.jar ${BACKUP_DIR}\/${SERVICE_NAME}\/${SERVICE_NAME}_${TIMESTAMP}.jar<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0echo &#034;\u2705 \u5df2\u5907\u4efd${SERVICE_NAME}\u5386\u53f2\u7248\u672c&#034;<br \/>\n\u00a0\u00a0\u00a0\u00a0fi<br \/>\n\u00a0\u00a0\u00a0\u00a0# 3. \u66ff\u6362\u65b0Jar\u5305<br \/>\n\u00a0\u00a0\u00a0\u00a0cp ${SERVICE_DIR}\/*.jar ${TARGET_DIR}\/${SERVICE_NAME}.jar<br \/>\n\u00a0\u00a0\u00a0\u00a0# 4. \u66ff\u6362\u751f\u4ea7\u914d\u7f6e\u6587\u4ef6<br \/>\n\u00a0\u00a0\u00a0\u00a0cp ${SERVICE_DIR}\/application-prod.yml ${TARGET_DIR}\/application-prod.yml<br \/>\n\u00a0\u00a0\u00a0\u00a0echo &#034;\u2705 ${SERVICE_NAME}\u6587\u4ef6\u66f4\u65b0\u5b8c\u6210&#034;<br \/>\ndone<\/p>\n<p>echo &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;<br \/>\necho &#034;\u6240\u6709\u6587\u4ef6\u66f4\u65b0\u5b8c\u6210&#xff0c;\u5373\u5c06\u6279\u91cf\u91cd\u542f\u670d\u52a1&#034;<br \/>\necho &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;<\/p>\n<p># \u6267\u884c\u6279\u91cf\u91cd\u542f\u811a\u672c<br \/>\n${APP_BASE}\/bin\/restart_all.sh<\/p>\n<p>echo &#034;&#xfffd;&#xfffd; \u6279\u91cf\u90e8\u7f72\u4efb\u52a1\u6267\u884c\u5b8c\u6bd5&#034;<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">4.2 \u811a\u672c2&#xff1a;\u6279\u91cf\u91cd\u542f\u811a\u672c restart_all.sh<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u529f\u80fd&#xff1a;\u904d\u5386\u6240\u6709\u670d\u52a1&#xff0c;\u9010\u4e2a\u91cd\u542fSystemd\u670d\u52a1&#xff0c;\u907f\u514d\u66b4\u529b\u505c\u673a<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n#!\/bin\/bash<br \/>\nAPP_BASE&#061;&#034;\/opt\/app&#034;<br \/>\nAPP_DIR&#061;&#034;${APP_BASE}\/apps&#034;<\/p>\n<p>echo &#034;\u5f00\u59cb\u6279\u91cf\u91cd\u542f\u6240\u6709SpringBoot\u670d\u52a1&#8230;&#034;<\/p>\n<p>for SERVICE_DIR in ${APP_DIR}\/*\/; do<br \/>\n\u00a0\u00a0\u00a0\u00a0SERVICE_NAME&#061;$(basename ${SERVICE_DIR%\/})<br \/>\n\u00a0\u00a0\u00a0\u00a0# \u4ec5\u91cd\u542f\u5df2\u6ce8\u518csystemd\u7684\u670d\u52a1<br \/>\n\u00a0\u00a0\u00a0\u00a0if systemctl list-unit-files | grep -q &#034;${SERVICE_NAME}.service&#034;; then<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0echo &#034;\u91cd\u542f\u670d\u52a1&#xff1a;${SERVICE_NAME}&#034;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0systemctl restart ${SERVICE_NAME}<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0# \u7b49\u5f852\u79d2&#xff0c;\u907f\u514d\u5e76\u53d1\u542f\u52a8\u7aef\u53e3\u51b2\u7a81<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sleep 2<br \/>\n\u00a0\u00a0\u00a0\u00a0fi<br \/>\ndone<\/p>\n<p>echo &#034;\u2705 \u6240\u6709\u670d\u52a1\u91cd\u542f\u6307\u4ee4\u6267\u884c\u5b8c\u6210&#034;<br \/>\necho &#034;\u53ef\u6267\u884c systemctl status \u670d\u52a1\u540d \u67e5\u770b\u542f\u52a8\u72b6\u6001&#034;<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">4.3 \u811a\u672c3&#xff1a;\u6279\u91cf\u505c\u6b62\u811a\u672c stop_all.sh<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n#!\/bin\/bash<br \/>\nAPP_BASE&#061;&#034;\/opt\/app&#034;<br \/>\nAPP_DIR&#061;&#034;${APP_BASE}\/apps&#034;<\/p>\n<p>echo &#034;\u5f00\u59cb\u6279\u91cf\u505c\u6b62\u6240\u6709\u670d\u52a1&#8230;&#034;<\/p>\n<p>for SERVICE_DIR in ${APP_DIR}\/*\/; do<br \/>\n\u00a0\u00a0\u00a0\u00a0SERVICE_NAME&#061;$(basename ${SERVICE_DIR%\/})<br \/>\n\u00a0\u00a0\u00a0\u00a0if systemctl list-unit-files | grep -q &#034;${SERVICE_NAME}.service&#034;; then<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0echo &#034;\u505c\u6b62\u670d\u52a1&#xff1a;${SERVICE_NAME}&#034;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0systemctl stop ${SERVICE_NAME}<br \/>\n\u00a0\u00a0\u00a0\u00a0fi<br \/>\ndone<\/p>\n<p>echo &#034;\u2705 \u6240\u6709\u670d\u52a1\u5df2\u5168\u90e8\u505c\u6b62&#034;<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">4.4 \u811a\u672c4&#xff1a;\u7248\u672c\u4e00\u952e\u56de\u6eda\u811a\u672c rollback.sh<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u529f\u80fd&#xff1a;\u90e8\u7f72\u51fa\u9519\u65f6&#xff0c;\u4e00\u952e\u56de\u6eda\u5230\u4e0a\u4e00\u4e2a\u7248\u672cJar\u5305<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n#!\/bin\/bash<br \/>\n# \u4f7f\u7528\u65b9\u5f0f&#xff1a;.\/rollback.sh \u670d\u52a1\u540d \u65f6\u95f4\u6233<br \/>\n# \u793a\u4f8b&#xff1a;.\/rollback.sh user-service 20250909_103000<br \/>\nAPP_BASE&#061;&#034;\/opt\/app&#034;<br \/>\nSERVICE_NAME&#061;$1<br \/>\nROLLBACK_TS&#061;$2<\/p>\n<p>if [ -z &#034;${SERVICE_NAME}&#034; ] || [ -z &#034;${ROLLBACK_TS}&#034; ]; then<br \/>\n\u00a0\u00a0\u00a0\u00a0echo &#034;\u7528\u6cd5\u9519\u8bef&#xff01;&#034;<br \/>\n\u00a0\u00a0\u00a0\u00a0echo &#034;\u6b63\u786e\u7528\u6cd5&#xff1a;.\/rollback.sh \u670d\u52a1\u540d \u5907\u4efd\u65f6\u95f4\u6233&#034;<br \/>\n\u00a0\u00a0\u00a0\u00a0echo &#034;\u793a\u4f8b&#xff1a;.\/rollback.sh user-service 20250909_103000&#034;<br \/>\n\u00a0\u00a0\u00a0\u00a0exit 1<br \/>\nfi<\/p>\n<p>BACKUP_JAR&#061;&#034;${APP_BASE}\/backup\/${SERVICE_NAME}\/${SERVICE_NAME}_${ROLLBACK_TS}.jar&#034;<br \/>\nTARGET_JAR&#061;&#034;${APP_BASE}\/apps\/${SERVICE_NAME}\/${SERVICE_NAME}.jar&#034;<\/p>\n<p>if [ ! -f &#034;${BACKUP_JAR}&#034; ]; then<br \/>\n\u00a0\u00a0\u00a0\u00a0echo &#034;\u274c \u672a\u627e\u5230\u5bf9\u5e94\u5907\u4efd\u7248\u672c&#xff01;&#034;<br \/>\n\u00a0\u00a0\u00a0\u00a0exit 1<br \/>\nfi<\/p>\n<p># \u8986\u76d6\u56de\u6eda<br \/>\ncp ${BACKUP_JAR} ${TARGET_JAR}<br \/>\n# \u91cd\u542f\u5bf9\u5e94\u670d\u52a1<br \/>\nsystemctl restart ${SERVICE_NAME}<br \/>\necho &#034;\u2705 ${SERVICE_NAME} \u5df2\u56de\u6eda\u81f3${ROLLBACK_TS}\u7248\u672c\u5e76\u91cd\u542f&#034;<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">4.5 \u8d4b\u4e88\u811a\u672c\u6267\u884c\u6743\u9650<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u5168\u90e8\u811a\u672c\u521b\u5efa\u5b8c\u6210\u540e&#xff0c;\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6388\u6743&#xff0c;\u6c38\u4e45\u751f\u6548&#xff1a;<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\nchmod &#043;x \/opt\/app\/bin\/*.sh<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4e94\u3001\u7b2c\u56db\u6b65&#xff1a;Systemd\u670d\u52a1\u6279\u91cf\u6ce8\u518c&#xff08;\u5173\u952e\u6b65\u9aa4&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u901a\u8fc7\u7edf\u4e00\u6a21\u677f\u4e3a\u51e0\u5341\u4e2a\u670d\u52a1\u751f\u6210\u5f00\u673a\u81ea\u542f\u3001\u6545\u969c\u81ea\u6108\u7684Systemd\u670d\u52a1\u914d\u7f6e&#xff0c;\u65e0\u9700\u9010\u4e2a\u624b\u52a8\u7f16\u5199\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">5.1 Systemd\u7edf\u4e00\u6a21\u677f\u89c4\u8303<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u6bcf\u4e2a\u670d\u52a1\u7684systemd\u6587\u4ef6\u7edf\u4e00\u5b58\u653e\u81f3<span style=\"background-color:#eff0f1\">\/etc\/systemd\/system\/<\/span>&#xff0c;\u6a21\u677f\u5982\u4e0b&#xff08;\u53ef\u76f4\u63a5\u590d\u7528&#xff09;&#xff1a;<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">ini<\/span><br \/>\n[Unit]<br \/>\nDescription&#061;%I SpringBoot Service<br \/>\nAfter&#061;network.target<\/p>\n<p>[Service]<br \/>\n# \u8fd0\u884c\u7528\u6237<br \/>\nUser&#061;app<br \/>\nGroup&#061;app<br \/>\n# \u670d\u52a1\u5de5\u4f5c\u76ee\u5f55<br \/>\nWorkingDirectory&#061;\/opt\/app\/apps\/%I<br \/>\n# \u542f\u52a8\u547d\u4ee4&#xff08;\u7edf\u4e00JVM\u53c2\u6570&#xff0c;\u53ef\u6839\u636e\u670d\u52a1\u5668\u914d\u7f6e\u8c03\u6574&#xff09;<br \/>\nExecStart&#061;\/usr\/bin\/java -Xms256m -Xmx512m -jar %I.jar &#8211;spring.profiles.active&#061;prod<br \/>\n# \u505c\u6b62\u53c2\u6570<br \/>\nSuccessExitStatus&#061;143<br \/>\n# \u6545\u969c\u81ea\u52a8\u91cd\u542f<br \/>\nRestart&#061;on-failure<br \/>\nRestartSec&#061;5<\/p>\n<p>[Install]<br \/>\nWantedBy&#061;multi-user.target<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">5.2 \u6279\u91cf\u521b\u5efaSystemd\u670d\u52a1\u5b9e\u64cd&#xff08;\u4e24\u79cd\u65b9\u5f0f&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u65b9\u5f0f\u4e00&#xff1a;\u5c11\u91cf\u670d\u52a1&#xff08;\u624b\u52a8\u521b\u5efa&#xff0c;1\u5206\u949f3-5\u4e2a&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4ee5user-service\u4e3a\u4f8b&#xff0c;\u521b\u5efa<span style=\"background-color:#eff0f1\">\/etc\/systemd\/system\/user-service.service<\/span>&#xff0c;\u7c98\u8d34\u4e0a\u8ff0\u6a21\u677f&#xff0c;\u65e0\u9700\u4fee\u6539\u53c2\u6570&#xff0c;\u6587\u4ef6\u540d\u4e0e\u670d\u52a1\u540d\u4e00\u81f4\u5373\u53ef\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u65b9\u5f0f\u4e8c&#xff1a;\u51e0\u5341\u670d\u52a1\u6279\u91cf\u81ea\u52a8\u751f\u6210&#xff08;\u63a8\u8350&#xff0c;\u6781\u901f\u843d\u5730&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u7f16\u5199\u6279\u91cf\u751f\u6210\u811a\u672c&#xff0c;\u4e00\u6b21\u6027\u751f\u6210\u6240\u6709\u670d\u52a1\u7684systemd\u914d\u7f6e&#xff0c;\u53ea\u9700\u586b\u5199\u6240\u6709\u670d\u52a1\u540d&#xff1a;<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n#!\/bin\/bash<br \/>\n# \u6279\u91cf\u751f\u6210systemd\u670d\u52a1\u6587\u4ef6<br \/>\nSERVICE_LIST&#061;(&#034;user-service&#034; &#034;order-service&#034; &#034;goods-service&#034; &#034;gateway-service&#034;) # \u6b64\u5904\u66ff\u6362\u4e3a\u4f60\u6240\u6709\u7684\u670d\u52a1\u540d<\/p>\n<p>for SERVICE in ${SERVICE_LIST[&#064;]}; do<br \/>\ncat &gt; \/etc\/systemd\/system\/${SERVICE}.service &lt;&lt; EOF<br \/>\n[Unit]<br \/>\nDescription&#061;${SERVICE} SpringBoot Service<br \/>\nAfter&#061;network.target<\/p>\n<p>[Service]<br \/>\nUser&#061;app<br \/>\nGroup&#061;app<br \/>\nWorkingDirectory&#061;\/opt\/app\/apps\/${SERVICE}<br \/>\nExecStart&#061;\/usr\/bin\/java -Xms256m -Xmx512m -jar ${SERVICE}.jar &#8211;spring.profiles.active&#061;prod<br \/>\nSuccessExitStatus&#061;143<br \/>\nRestart&#061;on-failure<br \/>\nRestartSec&#061;5<\/p>\n<p>[Install]<br \/>\nWantedBy&#061;multi-user.target<br \/>\nEOF<br \/>\ndone<\/p>\n<p>echo &#034;\u2705 \u6240\u6709\u670d\u52a1systemd\u914d\u7f6e\u6279\u91cf\u751f\u6210\u5b8c\u6210&#034;<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u6267\u884c\u811a\u672c\u540e&#xff0c;\u6240\u6709\u670d\u52a1\u81ea\u542f\u914d\u7f6e\u81ea\u52a8\u751f\u6210&#xff0c;\u65e0\u9700\u624b\u52a8\u64cd\u4f5c\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">5.3 \u52a0\u8f7d\u670d\u52a1\u5e76\u5f00\u542f\u5f00\u673a\u81ea\u542f<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n# \u91cd\u65b0\u52a0\u8f7d\u7cfb\u7edf\u670d\u52a1\u914d\u7f6e<br \/>\nsystemctl daemon-reload<\/p>\n<p># \u6279\u91cf\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f&#xff08;\u904d\u5386\u6240\u6709\u670d\u52a1&#xff09;<br \/>\nSERVICE_LIST&#061;(&#034;user-service&#034; &#034;order-service&#034; &#034;goods-service&#034; &#034;gateway-service&#034;)<br \/>\nfor SERVICE in ${SERVICE_LIST[&#064;]}; do<br \/>\n\u00a0\u00a0systemctl enable ${SERVICE}<br \/>\ndone<\/p>\n<p>echo &#034;\u2705 \u6240\u6709\u670d\u52a1\u5df2\u5f00\u542f\u5f00\u673a\u81ea\u542f&#034;<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u516d\u3001\u7b2c\u4e94\u6b65&#xff1a;\u6b63\u5f0f\u6279\u91cf\u90e8\u7f72\u4e0a\u7ebf&#xff08;\u5b8c\u6574\u4e0a\u7ebf\u6d41\u7a0b&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">6.1 \u672c\u5730\u4e0a\u4f20\u6587\u4ef6\u5230\u751f\u4ea7\u670d\u52a1\u5668<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u5c06\u672c\u5730\u89c4\u6574\u597d\u7684 local-deploy\u00a0\u5185\u6240\u6709\u670d\u52a1\u6587\u4ef6\u5939&#xff0c;\u6574\u4f53\u4e0a\u4f20\u81f3\u670d\u52a1\u5668 <span style=\"background-color:#eff0f1\">\/opt\/app\/deploy\/<\/span>\u00a0\u76ee\u5f55&#xff0c;\u4fdd\u8bc1\u76ee\u5f55\u7ed3\u6784\u4e00\u81f4\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4e0a\u4f20\u65b9\u5f0f&#xff1a;Xshell\/SFTP\u3001FinalShell\u3001rzsz\u547d\u4ee4\u5747\u53ef&#xff0c;\u4e0a\u4f20\u540e\u670d\u52a1\u5668\u76ee\u5f55&#xff1a;<span style=\"background-color:#eff0f1\">\/opt\/app\/deploy\/\u6bcf\u4e2a\u670d\u52a1\u540d\/jar&#043;yml<\/span>\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">6.2 \u6267\u884c\u4e00\u952e\u6279\u91cf\u90e8\u7f72<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n# \u8fdb\u5165\u811a\u672c\u76ee\u5f55<br \/>\ncd \/opt\/app\/bin<br \/>\n# \u6267\u884c\u6279\u91cf\u90e8\u7f72<br \/>\n.\/deploy.sh<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u811a\u672c\u81ea\u52a8\u5b8c\u6210&#xff1a;\u5907\u4efd\u65e7\u5305\u3001\u66ff\u6362\u65b0\u6587\u4ef6\u3001\u6279\u91cf\u91cd\u542f\u670d\u52a1&#xff0c;\u5168\u7a0b\u65e0\u9700\u4eba\u5de5\u5e72\u9884\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">6.3 \u9010\u4e2a\u6821\u9a8c\u670d\u52a1\u542f\u52a8\u72b6\u6001<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n# \u67e5\u770b\u5355\u4e2a\u670d\u52a1\u72b6\u6001<br \/>\nsystemctl status user-service<\/p>\n<p># \u67e5\u770b\u670d\u52a1\u5b9e\u65f6\u65e5\u5fd7&#xff08;\u6392\u67e5\u542f\u52a8\u5f02\u5e38&#xff09;<br \/>\njournalctl -fu user-service<\/p>\n<p># \u6279\u91cf\u67e5\u770b\u6240\u6709\u670d\u52a1\u8fd0\u884c\u72b6\u6001<br \/>\nsystemctl list-units | grep service<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4e03\u3001\u7b2c\u516d\u6b65&#xff1a;\u65e5\u5e38\u8fd0\u7ef4\u64cd\u4f5c\u624b\u518c&#xff08;\u751f\u4ea7\u5e38\u7528&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">7.1 \u65e5\u5e38\u66f4\u65b0\u90e8\u7f72&#xff08;\u8fed\u4ee3\u66f4\u65b0&#xff09;<\/p>\n<li style=\"text-align:left\">\u672c\u5730\u66f4\u65b0Jar\/\u914d\u7f6e&#xff0c;\u4fdd\u6301\u539f\u6709\u6587\u4ef6\u5939\u7ed3\u6784<\/li>\n<li style=\"text-align:left\">\u4e0a\u4f20\u81f3\u670d\u52a1\u5668<span style=\"background-color:#eff0f1\">\/opt\/app\/deploy\/<\/span>\u8986\u76d6\u5bf9\u5e94\u670d\u52a1\u6587\u4ef6\u5939<\/li>\n<li style=\"text-align:left\">\u6267\u884c <span style=\"background-color:#eff0f1\">\/opt\/app\/bin\/deploy.sh<\/span>\u00a0\u4e00\u952e\u66f4\u65b0\u91cd\u542f<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">7.2 \u7248\u672c\u56de\u6eda\u64cd\u4f5c&#xff08;\u90e8\u7f72\u5931\u8d25\u5e94\u6025&#xff09;<\/p>\n<li style=\"text-align:left\">\u8fdb\u5165\u5907\u4efd\u76ee\u5f55\u67e5\u770b\u5386\u53f2\u7248\u672c\u65f6\u95f4\u6233&#xff1a;<span style=\"background-color:#eff0f1\">ls \/opt\/app\/backup\/\u5bf9\u5e94\u670d\u52a1\u540d\/<\/span><\/li>\n<li style=\"text-align:left\">\u6267\u884c\u56de\u6eda\u811a\u672c&#xff1a;<span style=\"background-color:#eff0f1\">\/opt\/app\/bin\/rollback.sh \u670d\u52a1\u540d \u65f6\u95f4\u6233<\/span><\/li>\n<li style=\"text-align:left\">\u793a\u4f8b&#xff1a;<span style=\"background-color:#eff0f1\">\/opt\/app\/bin\/rollback.sh user-service 20250909_103000<\/span><\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">7.3 \u542f\u505c\u670d\u52a1\u547d\u4ee4<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n# \u6279\u91cf\u505c\u6b62\u6240\u6709\u670d\u52a1<br \/>\n\/opt\/app\/bin\/stop_all.sh<\/p>\n<p># \u6279\u91cf\u91cd\u542f\u6240\u6709\u670d\u52a1<br \/>\n\/opt\/app\/bin\/restart_all.sh<\/p>\n<p># \u5355\u4e2a\u670d\u52a1\u542f\u505c<br \/>\nsystemctl start\/stop\/restart \u670d\u52a1\u540d<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u516b\u3001\u751f\u4ea7\u4fdd\u969c\u4f18\u5316\u914d\u7f6e&#xff08;\u5fc5\u914d&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">8.1 \u9632\u706b\u5899\u653e\u884c\u7aef\u53e3<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u6240\u6709\u670d\u52a1\u7aef\u53e3\u7edf\u4e00\u653e\u884c&#xff0c;\u907f\u514d\u5916\u90e8\u65e0\u6cd5\u8bbf\u95ee&#xff1a;<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">bash<\/span><br \/>\n# \u653e\u884c\u5355\u4e2a\u7aef\u53e3\u793a\u4f8b<br \/>\nfirewall-cmd &#8211;permanent &#8211;add-port&#061;8080\/tcp<br \/>\n# \u91cd\u8f7d\u9632\u706b\u5899<br \/>\nfirewall-cmd &#8211;reload<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">8.2 \u7edf\u4e00\u65e5\u5fd7\u89c4\u8303<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u6240\u6709\u670d\u52a1\u914d\u7f6e\u65e5\u5fd7\u8f93\u51fa\u8def\u5f84\u81f3<span style=\"background-color:#eff0f1\">\/opt\/app\/logs\/\u670d\u52a1\u540d\/<\/span>&#xff0c;\u7edf\u4e00\u5f52\u96c6&#xff0c;\u65b9\u4fbf\u6392\u67e5\u95ee\u9898&#xff0c;\u907f\u514d\u65e5\u5fd7\u6563\u843d\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">8.3 \u670d\u52a1\u5668\u5f00\u673a\u81ea\u542f\u6821\u9a8c<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u91cd\u542f\u670d\u52a1\u5668\u6d4b\u8bd5&#xff1a;<span style=\"background-color:#eff0f1\">reboot<\/span>&#xff0c;\u91cd\u542f\u540e\u6267\u884c<span style=\"background-color:#eff0f1\">systemctl list-units | grep service<\/span>&#xff0c;\u786e\u8ba4\u6240\u6709\u670d\u52a1\u81ea\u52a8\u542f\u52a8\u6210\u529f\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4e5d\u3001\u65b9\u6848\u843d\u5730\u603b\u7ed3<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u672c\u65b9\u6848\u5168\u7a0b\u65e0\u4ee3\u7801\u6539\u9020\u3001\u65e0\u5bb9\u5668\u4f9d\u8d56&#xff0c;\u901a\u8fc7\u6807\u51c6\u5316\u76ee\u5f55&#043;\u6279\u91cf\u811a\u672c&#043;Systemd\u6258\u7ba1&#xff0c;\u5b8c\u7f8e\u9002\u914d\u6570\u5341\u4e2aSpringBoot Jar\u5305\u7684\u6279\u91cf\u90e8\u7f72\u573a\u666f\u3002\u9996\u6b21\u90e8\u7f72\u5b8c\u6210\u540e&#xff0c;\u540e\u7eed\u6240\u6709\u8fed\u4ee3\u66f4\u65b0\u3001\u542f\u505c\u3001\u56de\u6eda\u5747\u4e3a\u4e00\u952e\u64cd\u4f5c&#xff0c;\u6781\u5927\u964d\u4f4e\u8fd0\u7ef4\u6210\u672c&#xff0c;\u540c\u65f6\u6ee1\u8db3\u751f\u4ea7\u73af\u5883\u7684\u7a33\u5b9a\u6027\u3001\u81ea\u6108\u6027\u3001\u53ef\u56de\u6eda\u6027&#xff0c;\u662f\u4e2d\u5c0f\u89c4\u6a21\u591a\u670d\u52a1\u90e8\u7f72\u7684\u6700\u4f18\u8f7b\u91cf\u65b9\u6848\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\n<h2>\u6279\u91cf\u751f\u6210 systemd \u670d\u52a1\u6587\u4ef6\u811a\u672c<\/h2>\n<p>\u4f7f\u7528\u8bf4\u660e&#xff1a;<\/p>\n<li>\u4fee\u6539\u811a\u672c\u91cc SERVICE_LIST \u6570\u7ec4&#xff0c;\u628a\u4f60\u5168\u90e8\u670d\u52a1\u540d\u79f0\u586b\u8fdb\u53bb&#xff08;\u670d\u52a1\u540d\u5fc5\u987b\u548c jar \u5305\u540d\u79f0\u4fdd\u6301\u4e00\u81f4&#xff0c;\u5c0f\u5199\u3001\u4e2d\u5212\u7ebf&#xff0c;\u4e0d\u8981\u7a7a\u683c&#xff09;<\/li>\n<li>\u670d\u52a1\u5668\u6267\u884c\u9700\u8981 root \u6743\u9650&#xff0c;\u56e0\u4e3a\u8981\u5199\u5165 \/etc\/systemd\/system\/<\/li>\n<li>\u811a\u672c\u4f1a\u81ea\u52a8\u751f\u6210\u6bcf\u4e2a\u670d\u52a1\u5bf9\u5e94\u7684 xxx.service \u6587\u4ef6<\/li>\n<li>\u6267\u884c\u5b8c\u811a\u672c\u540e&#xff0c;\u6267\u884c systemctl daemon-reload \u52a0\u8f7d\u914d\u7f6e&#xff0c;\u518d\u6279\u91cf enable \u5f00\u673a\u81ea\u542f<\/li>\n<p>#!\/bin\/bash<br \/>\n# batch-gen-systemd.sh<br \/>\n# \u6279\u91cf\u751f\u6210springboot\u670d\u52a1systemd\u5355\u5143\u6587\u4ef6<br \/>\n# \u6267\u884c\u65b9\u5f0f&#xff1a;sudo bash batch-gen-systemd.sh<\/p>\n<p># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u5728\u8fd9\u91cc\u586b\u5199\u4f60\u6240\u6709\u7684\u670d\u52a1\u540d\u79f0 &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\nSERVICE_LIST&#061;(<br \/>\n&#034;user-service&#034;<br \/>\n&#034;order-service&#034;<br \/>\n&#034;goods-service&#034;<br \/>\n&#034;gateway-service&#034;<br \/>\n&#034;file-service&#034;<br \/>\n&#034;message-service&#034;<br \/>\n&#034;pay-service&#034;<br \/>\n&#034;auth-service&#034;<br \/>\n&#034;log-service&#034;<br \/>\n&#034;monitor-service&#034;<br \/>\n# \u7ee7\u7eed\u8ffd\u52a0\u5269\u4e0b\u6240\u6709\u670d\u52a1&#xff0c;\u4e00\u884c\u4e00\u4e2a&#xff0c;\u53cc\u5f15\u53f7\u5305\u88f9<br \/>\n)<br \/>\n# &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/p>\n<p>for SERVICE in &#034;${SERVICE_LIST[&#064;]}&#034;; do<br \/>\ncat &gt; \/etc\/systemd\/system\/${SERVICE}.service &lt;&lt; EOF<br \/>\n[Unit]<br \/>\nDescription&#061;${SERVICE} SpringBoot Service<br \/>\nAfter&#061;network.target<\/p>\n<p>[Service]<br \/>\nUser&#061;app<br \/>\nGroup&#061;app<br \/>\nWorkingDirectory&#061;\/opt\/app\/apps\/${SERVICE}<br \/>\nExecStart&#061;\/usr\/bin\/java -Xms256m -Xmx512m -jar ${SERVICE}.jar &#8211;spring.profiles.active&#061;prod<br \/>\nSuccessExitStatus&#061;143<br \/>\nRestart&#061;on-failure<br \/>\nRestartSec&#061;5<\/p>\n<p>[Install]<br \/>\nWantedBy&#061;multi-user.target<br \/>\nEOF<br \/>\necho &#034;\u5df2\u751f\u6210&#xff1a;\/etc\/systemd\/system\/${SERVICE}.service&#034;<br \/>\ndone<\/p>\n<p>echo &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;<br \/>\necho &#034;\u2705 \u5168\u90e8systemd\u670d\u52a1\u6587\u4ef6\u751f\u6210\u5b8c\u6210&#xff01;&#034;<br \/>\necho &#034;\u63a5\u4e0b\u6765\u6267\u884c\u4e24\u6761\u547d\u4ee4&#xff1a;&#034;<br \/>\necho &#034;systemctl daemon-reload&#034;<br \/>\necho &#034;\u7136\u540e\u6267\u884c\u4e0b\u9762\u6279\u91cfenable\u811a\u672c\u5f00\u542f\u5f00\u673a\u81ea\u542f&#034;<\/p>\n<h2>\u6279\u91cf enable \u5f00\u673a\u81ea\u542f\u811a\u672c<\/h2>\n<p>\u811a\u672c\u5185 SERVICE_LIST \u548c\u4e0a\u9762\u4fdd\u6301\u4e00\u6a21\u4e00\u6837&#xff0c;\u590d\u5236\u7c98\u8d34&#xff0c;\u540d\u5b57&#xff1a;batch-enable.sh<\/p>\n<p>#!\/bin\/bash<br \/>\n# batch-enable.sh<br \/>\n# \u6279\u91cf\u8bbe\u7f6e\u670d\u52a1\u5f00\u673a\u81ea\u542f<br \/>\nSERVICE_LIST&#061;(<br \/>\n&#034;user-service&#034;<br \/>\n&#034;order-service&#034;<br \/>\n&#034;goods-service&#034;<br \/>\n&#034;gateway-service&#034;<br \/>\n&#034;file-service&#034;<br \/>\n&#034;message-service&#034;<br \/>\n&#034;pay-service&#034;<br \/>\n&#034;auth-service&#034;<br \/>\n&#034;log-service&#034;<br \/>\n&#034;monitor-service&#034;<br \/>\n# \u548c\u4e0a\u9762\u5217\u8868\u4fdd\u6301\u4e00\u81f4<br \/>\n)<\/p>\n<p>for SERVICE in &#034;${SERVICE_LIST[&#064;]}&#034;; do<br \/>\n  systemctl enable ${SERVICE}<br \/>\n  echo &#034;\u5df2\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f&#xff1a;${SERVICE}&#034;<br \/>\ndone<\/p>\n<p>echo &#034;\u2705 \u5168\u90e8\u670d\u52a1\u5f00\u673a\u81ea\u542f\u914d\u7f6e\u5b8c\u6210&#034;<\/p>\n<h2>\u914d\u5957&#xff1a;\u6279\u91cf\u68c0\u67e5\u6240\u6709\u670d\u52a1\u72b6\u6001\u811a\u672c batch-status.sh<\/h2>\n<p>\u65e5\u5e38\u8fd0\u7ef4\u4e00\u952e\u67e5\u770b\u5168\u90e8\u670d\u52a1\u662f\u5426 running<\/p>\n<p>#!\/bin\/bash<br \/>\n# batch-status.sh<br \/>\nSERVICE_LIST&#061;(<br \/>\n&#034;user-service&#034;<br \/>\n&#034;order-service&#034;<br \/>\n&#034;goods-service&#034;<br \/>\n&#034;gateway-service&#034;<br \/>\n&#034;file-service&#034;<br \/>\n&#034;message-service&#034;<br \/>\n&#034;pay-service&#034;<br \/>\n&#034;auth-service&#034;<br \/>\n&#034;log-service&#034;<br \/>\n&#034;monitor-service&#034;<br \/>\n)<\/p>\n<p>for SERVICE in &#034;${SERVICE_LIST[&#064;]}&#034;; do<br \/>\n  echo &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; ${SERVICE} &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;<br \/>\n  systemctl status ${SERVICE} &#8211;no-pager<br \/>\ndone<\/p>\n<h3>\u4f7f\u7528\u5b8c\u6574\u64cd\u4f5c\u6b65\u9aa4<\/h3>\n<li>\u5728\u670d\u52a1\u5668 \/opt\/app\/bin \u521b\u5efa\u4e09\u4e2a\u6587\u4ef6&#xff0c;\u5206\u522b\u7c98\u8d34\u4e0a\u9762\u4e09\u6bb5\u4ee3\u7801<\/li>\n<p>cd \/opt\/app\/bin<br \/>\nvim batch-gen-systemd.sh<br \/>\nvim batch-enable.sh<br \/>\nvim batch-status.sh<\/p>\n<li>\u6388\u6743<\/li>\n<p>chmod &#043;x batch-gen-systemd.sh batch-enable.sh batch-status.sh<\/p>\n<li>\u6267\u884c\u751f\u6210 systemd \u914d\u7f6e&#xff08;\u9700\u8981 sudo&#xff09;<\/li>\n<p>sudo .\/batch-gen-systemd.sh<\/p>\n<li>\u91cd\u8f7d systemd<\/li>\n<p>sudo systemctl daemon-reload<\/p>\n<li>\u6279\u91cf\u5f00\u542f\u5f00\u673a\u81ea\u542f<\/li>\n<p>sudo .\/batch-enable.sh<\/p>\n<li>\u6821\u9a8c\u5168\u90e8\u670d\u52a1\u72b6\u6001<\/li>\n<p>.\/batch-status.sh<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848&#xff08;ShellSystemd\u5b8c\u6574\u7248&#xff09;\u4e00\u3001\u65b9\u6848\u6574\u4f53\u6982\u8ff01.1 \u9002\u7528\u573a\u666f\u672c\u5730\u5b58\u5728\u6570\u5341\u4e2a\u72ec\u7acbSpringBoot Jar\u5305&#xff0c;\u5355\/\u5c11\u91cf\u751f\u4ea7\u670d\u52a1\u5668\u90e8\u7f72&#xff0c;\u65e0\u9700\u5bb9\u5668\u5316\u3001\u4f4e\u6210\u672c\u3001\u5feb\u901f\u843d\u5730&#xff0c;\u652f\u6301\u6279\u91cf\u66f4\u65b0\u3001\u6279\u91cf\u542f\u505c\u3001\u7248\u672c\u5907\u4efd\u56de\u6eda\u3001\u5f00\u673a\u81ea\u542f\u3001\u6545\u969c\u81ea\u52a8\u91cd\u542f&#xff0c;\u9002\u914d\u4e2d\u5c0f\u578b\u9879\u76ee\u8fd0\u7ef4\u573a\u666f\u30021.2 \u65b9\u6848\u6838\u5fc3\u4f18\u52bf\u65e0\u9700\u4fee\u6539\u4e1a\u52a1\u4ee3\u7801&#xff0c;\u539f\u6709Jar\u5305\u76f4\u63a5\u590d\u7528\u7eafShell<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[166,98,292],"topic":[],"class_list":["post-104555","post","type-post","status-publish","format-standard","hentry","category-server","tag-jar","tag-spring-boot","tag-292"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848\uff08Shell+Systemd\u5b8c\u6574\u7248\uff09 - \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\/104555.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848\uff08Shell+Systemd\u5b8c\u6574\u7248\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848&#xff08;ShellSystemd\u5b8c\u6574\u7248&#xff09;\u4e00\u3001\u65b9\u6848\u6574\u4f53\u6982\u8ff01.1 \u9002\u7528\u573a\u666f\u672c\u5730\u5b58\u5728\u6570\u5341\u4e2a\u72ec\u7acbSpringBoot Jar\u5305&#xff0c;\u5355\/\u5c11\u91cf\u751f\u4ea7\u670d\u52a1\u5668\u90e8\u7f72&#xff0c;\u65e0\u9700\u5bb9\u5668\u5316\u3001\u4f4e\u6210\u672c\u3001\u5feb\u901f\u843d\u5730&#xff0c;\u652f\u6301\u6279\u91cf\u66f4\u65b0\u3001\u6279\u91cf\u542f\u505c\u3001\u7248\u672c\u5907\u4efd\u56de\u6eda\u3001\u5f00\u673a\u81ea\u542f\u3001\u6545\u969c\u81ea\u52a8\u91cd\u542f&#xff0c;\u9002\u914d\u4e2d\u5c0f\u578b\u9879\u76ee\u8fd0\u7ef4\u573a\u666f\u30021.2 \u65b9\u6848\u6838\u5fc3\u4f18\u52bf\u65e0\u9700\u4fee\u6539\u4e1a\u52a1\u4ee3\u7801&#xff0c;\u539f\u6709Jar\u5305\u76f4\u63a5\u590d\u7528\u7eafShell\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/104555.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-12T10:25:16+00:00\" \/>\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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104555.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/104555.html\",\"name\":\"SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848\uff08Shell+Systemd\u5b8c\u6574\u7248\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-12T10:25:16+00:00\",\"dateModified\":\"2026-09-12T10:25:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/104555.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/104555.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104555.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848\uff08Shell+Systemd\u5b8c\u6574\u7248\uff09\"}]},{\"@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":"SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848\uff08Shell+Systemd\u5b8c\u6574\u7248\uff09 - \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\/104555.html","og_locale":"zh_CN","og_type":"article","og_title":"SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848\uff08Shell+Systemd\u5b8c\u6574\u7248\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848&#xff08;ShellSystemd\u5b8c\u6574\u7248&#xff09;\u4e00\u3001\u65b9\u6848\u6574\u4f53\u6982\u8ff01.1 \u9002\u7528\u573a\u666f\u672c\u5730\u5b58\u5728\u6570\u5341\u4e2a\u72ec\u7acbSpringBoot Jar\u5305&#xff0c;\u5355\/\u5c11\u91cf\u751f\u4ea7\u670d\u52a1\u5668\u90e8\u7f72&#xff0c;\u65e0\u9700\u5bb9\u5668\u5316\u3001\u4f4e\u6210\u672c\u3001\u5feb\u901f\u843d\u5730&#xff0c;\u652f\u6301\u6279\u91cf\u66f4\u65b0\u3001\u6279\u91cf\u542f\u505c\u3001\u7248\u672c\u5907\u4efd\u56de\u6eda\u3001\u5f00\u673a\u81ea\u542f\u3001\u6545\u969c\u81ea\u52a8\u91cd\u542f&#xff0c;\u9002\u914d\u4e2d\u5c0f\u578b\u9879\u76ee\u8fd0\u7ef4\u573a\u666f\u30021.2 \u65b9\u6848\u6838\u5fc3\u4f18\u52bf\u65e0\u9700\u4fee\u6539\u4e1a\u52a1\u4ee3\u7801&#xff0c;\u539f\u6709Jar\u5305\u76f4\u63a5\u590d\u7528\u7eafShell","og_url":"https:\/\/www.wsisp.com\/helps\/104555.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-12T10:25:16+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/104555.html","url":"https:\/\/www.wsisp.com\/helps\/104555.html","name":"SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848\uff08Shell+Systemd\u5b8c\u6574\u7248\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-12T10:25:16+00:00","dateModified":"2026-09-12T10:25:16+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/104555.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/104555.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/104555.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"SpringBoot\u6570\u5341Jar\u5305\u6279\u91cf\u751f\u4ea7\u90e8\u7f72\u843d\u5730\u5b9e\u65bd\u65b9\u6848\uff08Shell+Systemd\u5b8c\u6574\u7248\uff09"}]},{"@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\/104555","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=104555"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/104555\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=104555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=104555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=104555"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=104555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}