{"id":69165,"date":"2026-01-31T07:41:27","date_gmt":"2026-01-30T23:41:27","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/69165.html"},"modified":"2026-01-31T07:41:27","modified_gmt":"2026-01-30T23:41:27","slug":"%e3%80%90%e5%ae%9e%e6%93%8d%e6%8c%87%e5%8d%97%e3%80%91apache-apollo-%e4%bb%8e-windows-%e8%bf%81%e7%a7%bb%e8%87%b3-linux-%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%85%a8%e6%b5%81%e7%a8%8b%ef%bc%88%e9%99%84","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/69165.html","title":{"rendered":"\u3010\u5b9e\u64cd\u6307\u5357\u3011Apache Apollo \u4ece Windows \u8fc1\u79fb\u81f3 Linux \u670d\u52a1\u5668\u5168\u6d41\u7a0b\uff08\u9644\u907f\u5751\u624b\u518c\uff09"},"content":{"rendered":"<p>\u80cc\u666f&#xff1a;\u4f5c\u4e3a\u8f7b\u91cf\u7ea7\u6d88\u606f\u4e2d\u95f4\u4ef6&#xff0c;Apache Apollo \u5e38\u88ab\u7528\u4e8e MQTT \u534f\u8bae\u7684\u6d88\u606f\u901a\u4fe1\u573a\u666f\u3002\u4f46\u5b9e\u9645\u90e8\u7f72\u4e2d&#xff0c;\u4e0d\u5c11\u540c\u5b66\u4f1a\u9047\u5230\u4ece Windows \u6d4b\u8bd5\u73af\u5883\u8fc1\u79fb\u5230 Linux \u751f\u4ea7\u73af\u5883\u7684\u9700\u6c42 \u2014\u2014 \u8fd9\u8fc7\u7a0b\u770b\u4f3c\u7b80\u5355&#xff0c;\u5374\u5bb9\u6613\u8e29 \u201c\u8def\u5f84\u517c\u5bb9\u201d\u201c\u6743\u9650\u201d\u201c\u6570\u636e\u5b8c\u6574\u6027\u201d \u7684\u5751\u3002<\/p>\n<p>\u672c\u6587\u5c31\u5e26\u4f60\u8d70\u5b8c Apollo \u8de8\u7cfb\u7edf\u8fc1\u79fb\u7684\u5168\u6d41\u7a0b&#xff0c;\u4ece\u73af\u5883\u51c6\u5907\u5230\u670d\u52a1\u9a8c\u8bc1&#xff0c;\u4e00\u6b21\u641e\u5b9a&#xff01;<\/p>\n<h3>\u4e00\u3001\u8fc1\u79fb\u524d\u5fc5\u77e5&#xff1a;\u6838\u5fc3\u80cc\u666f\u4e0e\u73af\u5883\u4fe1\u606f<\/h3>\n<p>\u5148\u660e\u786e\u8fc1\u79fb\u7684\u57fa\u7840\u4fe1\u606f&#xff0c;\u907f\u514d\u7248\u672c \/ \u73af\u5883\u4e0d\u517c\u5bb9&#xff1a;<br \/>\nApollo \u7248\u672c&#xff1a;\u5fc5\u987b\u4fdd\u6301\u4e00\u81f4&#xff08;\u672c\u6587\u4ee5 1.7.1 \u4e3a\u4f8b&#xff0c;\u8fd9\u662f Apollo \u6700\u540e\u4e00\u4e2a\u7a33\u5b9a\u7248&#xff09;&#xff1b;<br \/>\nJDK \u7248\u672c&#xff1a;\u7edf\u4e00\u7528 JDK 1.8&#xff08;Apollo \u5bf9\u9ad8\u7248\u672c JDK \u517c\u5bb9\u6027\u8f83\u5dee&#xff09;&#xff1b;<br \/>\n\u5b9e\u4f8b\u76ee\u5f55&#xff1a;<br \/>\n\u539f Windows&#xff1a;D:\\\\apache-apollo-1.7.1\\\\bin\\\\mybroker<br \/>\n\u76ee\u6807 Linux&#xff1a;\/home\/apollo\/apache-apollo-1.7.1\/bin\/mybroker<\/p>\n<h3>\u4e8c\u3001\u8fc1\u79fb\u524d\u51c6\u5907&#xff1a;Linux \u73af\u5883\u5148\u642d\u597d<\/h3>\n<p>\u8fc1\u79fb\u524d\u5148\u628a Linux \u73af\u5883\u914d\u7f6e\u5230\u4f4d&#xff0c;\u907f\u514d\u540e\u7eed \u201c\u5361\u58f3\u201d\u3002<br \/>\n1. \u5b89\u88c5 JDK 1.8&#xff08;\u4ee5 CentOS \u4e3a\u4f8b&#xff09;<br \/>\nApollo \u4f9d\u8d56 JDK 1.8&#xff0c;\u9ad8\u7248\u672c\u4f1a\u62a5\u7c7b\u52a0\u8f7d\u9519\u8bef&#xff0c;\u6240\u4ee5\u5fc5\u987b\u4e25\u683c\u5339\u914d&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u4e0b\u8f7d JDK 1.8&#xff08;\u6216\u4e0a\u4f20\u672c\u5730\u5b89\u88c5\u5305&#xff09;<\/span><br \/>\n<span class=\"token function\">wget<\/span> https:\/\/repo.huaweicloud.com\/java\/jdk\/8u202-b08\/jdk-8u202-linux-x64.tar.gz<br \/>\n<span class=\"token comment\"># \u89e3\u538b\u5230 \/usr\/local<\/span><br \/>\n<span class=\"token function\">tar<\/span> -zxvf jdk-8u202-linux-x64.tar.gz -C \/usr\/local\/<br \/>\n<span class=\"token comment\"># \u914d\u7f6e\u73af\u5883\u53d8\u91cf&#xff08;\u7f16\u8f91 \/etc\/profile&#xff09;<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;export JAVA_HOME&#061;\/usr\/local\/jdk1.8.0_202&#039;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> \/etc\/profile<br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;export PATH&#061;$JAVA_HOME\/bin:$PATH&#039;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> \/etc\/profile<br \/>\n<span class=\"token builtin class-name\">source<\/span> \/etc\/profile<br \/>\n<span class=\"token comment\"># \u9a8c\u8bc1<\/span><br \/>\njava -version<\/p>\n<p>2. \u5b89\u88c5 Apollo 1.7.1&#xff08;\u4e0e Windows \u7248\u672c\u4e00\u81f4&#xff09;<\/p>\n<p><span class=\"token comment\"># \u4e0b\u8f7d Apollo \u5b89\u88c5\u5305<\/span><br \/>\n<span class=\"token function\">wget<\/span> http:\/\/apache.fayea.com\/activemq\/activemq-apollo\/1.7.1\/apache-apollo-1.7.1-unix-distro.tar.gz<br \/>\n<span class=\"token comment\"># \u89e3\u538b<\/span><br \/>\n<span class=\"token function\">tar<\/span> -zxvf apache-apollo-1.7.1-unix-distro.tar.gz -C \/home\/apollo\/<br \/>\n<span class=\"token comment\"># \u8d4b\u4e88\u6267\u884c\u6743\u9650&#xff08;Linux \u5fc5\u987b&#xff01;&#xff09;<\/span><br \/>\n<span class=\"token function\">chmod<\/span> -R <span class=\"token number\">755<\/span> \/home\/apollo\/apache-apollo-1.7.1<\/p>\n<h3>\u4e09\u3001\u6838\u5fc3\u6b65\u9aa4&#xff1a;\u8fc1\u79fb\u5173\u952e\u6587\u4ef6<\/h3>\n<p>Apollo \u7684\u914d\u7f6e\u3001\u6570\u636e\u90fd\u5b58\u5728 ** \u5b9e\u4f8b\u76ee\u5f55&#xff08;mybroker&#xff09;** \u91cc&#xff0c;\u53ea\u9700\u628a\u8fd9\u4e9b\u6587\u4ef6\u4ece Windows \u4f20\u5230 Linux \u5373\u53ef\u3002<br \/>\n\u8981\u8fc1\u79fb\u7684\u6587\u4ef6\u6e05\u5355&#xff08;\u5fc5\u4f20&#xff09;<br \/>\n\u7528 WinSCP\/FileZilla \u628a Windows \u7aef mybroker \u76ee\u5f55\u4e0b\u7684\u8fd9\u4e9b\u5185\u5bb9&#xff0c;\u4f20\u5230 Linux \u7aef\u7684 mybroker \u76ee\u5f55&#xff1a;<\/p>\n<table>\n<tr>Windows \u8def\u5f84Linux \u8def\u5f84\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>mybroker\/etc\/<\/td>\n<td>\/home\/apollo\/apache-apollo-1.7.1\/bin\/mybroker\/etc\/<\/td>\n<td>\u7aef\u53e3\u3001\u8ba4\u8bc1\u7b49\u6838\u5fc3\u914d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>mybroker\/data\/<\/td>\n<td>\/home\/apollo\/apache-apollo-1.7.1\/bin\/mybroker\/data\/<\/td>\n<td>\u6301\u4e45\u5316\u6d88\u606f\u6570\u636e&#xff08;\u91cd\u8981&#xff01;&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>mybroker\/etc\/users.properties<\/td>\n<td>\/home\/apollo\/apache-apollo-1.7.1\/bin\/mybroker\/etc\/users.properties<\/td>\n<td>\u7ba1\u7406\u540e\u53f0\u8d26\u53f7\u5bc6\u7801<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260130234125-697d41a5d0545.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260130234126-697d41a633549.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>\u56db\u3001Linux \u7aef\u9002\u914d&#xff1a;\u907f\u5751\u5173\u952e&#xff01;<\/h3>\n<p>Windows \u548c Linux \u7684 \u201c\u5dee\u5f02\u201d \u662f\u8fc1\u79fb\u7684\u5751\u70b9&#xff0c;\u8fd9\u4e00\u6b65\u5fc5\u987b\u505a&#xff1a;<br \/>\n1. \u4fee\u590d\u6587\u4ef6\u6743\u9650&#xff08;Linux \u7279\u6709&#xff09;<br \/>\nWindows \u4f20\u8fc7\u6765\u7684\u6587\u4ef6\u9ed8\u8ba4\u6743\u9650\u53ef\u80fd\u4e0d\u8db3&#xff0c;\u5bfc\u81f4 Apollo \u542f\u52a8\u5931\u8d25&#xff1a;<\/p>\n<p><span class=\"token function\">chmod<\/span> -R <span class=\"token number\">755<\/span> \/home\/apollo\/apache-apollo-1.7.1\/bin\/mybroker<\/p>\n<p>2. \u914d\u7f6e\u6587\u4ef6\u8def\u5f84\u9002\u914d<br \/>\n\u6253\u5f00 Linux \u7aef\u7684 mybroker\/etc\/apollo.xml&#xff0c;\u68c0\u67e5\u8def\u5f84\u914d\u7f6e&#xff1a;<br \/>\nWindows \u7528 \\\\ \u4f5c\u4e3a\u8def\u5f84\u5206\u9694\u7b26&#xff0c;Linux \u7528 \/&#xff1b;<br \/>\n\u4f46 Apollo \u652f\u6301 ${apollo.base} \u53d8\u91cf&#xff08;\u81ea\u52a8\u8bc6\u522b\u5b9e\u4f8b\u76ee\u5f55&#xff09;&#xff0c;\u6240\u4ee5\u53ea\u8981\u539f\u914d\u7f6e\u7528\u4e86\u76f8\u5bf9\u8def\u5f84&#xff0c;Linux \u4f1a\u81ea\u52a8\u9002\u914d&#xff0c;\u65e0\u9700\u624b\u52a8\u4fee\u6539\u3002<br \/>\n\u4e3e\u4e2a\u4f8b\u5b50&#xff1a;<br \/>\n\u539f Windows \u914d\u7f6e directory&#061;\u201cD:\\\\apollo\\\\data\u201d \u2192 Linux \u81ea\u52a8\u53d8\u6210 ${apollo.base}\/data\u3002<\/p>\n<h3>\u4e94\u3001\u542f\u52a8 &#043; \u9a8c\u8bc1&#xff1a;\u786e\u4fdd\u670d\u52a1\u6b63\u5e38<\/h3>\n<li>\u542f\u52a8 Linux \u7aef Apollo<br \/>\n\u7528\u4e4b\u524d\u5199\u597d\u7684 apollo.sh \u811a\u672c\u542f\u52a8&#xff08;\u6ca1\u811a\u672c\u7684\u8bdd&#xff0c;\u76f4\u63a5\u7528\u5b9e\u4f8b\u7684\u542f\u52a8\u547d\u4ee4&#xff09;&#xff1a;<\/li>\n<p><span class=\"token builtin class-name\">cd<\/span> \/home\/apollo\/apache-apollo-1.7.1\/bin<br \/>\n<span class=\"token comment\"># \u542f\u52a8\u670d\u52a1<\/span><br \/>\n.\/apollo.sh start<br \/>\n<span class=\"token comment\"># \u67e5\u770b\u72b6\u6001&#xff08;\u663e\u793a\u201c\u8fd0\u884c\u4e2d\u201d\u5219\u6210\u529f&#xff09;<\/span><br \/>\n.\/apollo.sh status<\/p>\n<p>\u6b64\u5904\u4e3a\u542f\u52a8\u811a\u672c<\/p>\n<p><span class=\"token shebang important\">#!\/bin\/bash<\/span><br \/>\n<span class=\"token comment\"># Apache Apollo Linux \u542f\u52a8\u811a\u672c<\/span><br \/>\n<span class=\"token comment\"># \u529f\u80fd&#xff1a;\u66ff\u4ee3Windows\u7684apollo.cmd&#xff0c;\u652f\u6301\u542f\u52a8\/\u505c\u6b62\/\u91cd\u542f\/\u72b6\u6001\u67e5\u8be2<\/span><\/p>\n<p><span class=\"token comment\"># &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061; \u914d\u7f6e\u533a&#xff08;\u6839\u636e\u4f60\u7684\u5b9e\u9645\u8def\u5f84\u4fee\u6539&#xff09;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/span><br \/>\n<span class=\"token comment\"># Apollo\u5b89\u88c5\u6839\u76ee\u5f55&#xff08;\u66ff\u6362\u4e3a\u4f60\u7684apollo\u89e3\u538b\u8def\u5f84&#xff09;<\/span><br \/>\n<span class=\"token assign-left variable\">APOLLO_HOME<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/home\/\u4f60\u7684\u7528\u6237\u540d\/Downloads\/apache-apollo-1.7.1&#034;<\/span><br \/>\n<span class=\"token comment\"># Broker\u5b9e\u4f8b\u76ee\u5f55&#xff08;\u521b\u5efa\u7684mybroker\u8def\u5f84&#xff09;<\/span><br \/>\n<span class=\"token assign-left variable\">APOLLO_BASE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">${APOLLO_HOME}<\/span>\/bin\/mybroker&#034;<\/span><br \/>\n<span class=\"token comment\"># Java\u5b89\u88c5\u76ee\u5f55&#xff08;\u5982\u679c\u5df2\u914d\u7f6eJAVA_HOME\u73af\u5883\u53d8\u91cf&#xff0c;\u53ef\u7559\u7a7a&#xff09;<\/span><br \/>\n<span class=\"token assign-left variable\">JAVA_HOME<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/usr\/lib\/jvm\/jdk1.8.0_381&#034;<\/span><br \/>\n<span class=\"token comment\"># JVM\u53c2\u6570\u914d\u7f6e&#xff08;\u548cWindows\u7248\u4fdd\u6301\u4e00\u81f4&#xff09;<\/span><br \/>\n<span class=\"token assign-left variable\">JVM_FLAGS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;-server -Xmx1G -XX:-UseBiasedLocking&#034;<\/span><br \/>\n<span class=\"token comment\"># \u65e5\u5fd7\u8f93\u51fa\u76ee\u5f55<\/span><br \/>\n<span class=\"token assign-left variable\">LOG_DIR<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">${APOLLO_BASE}<\/span>\/logs&#034;<\/span><br \/>\n<span class=\"token comment\"># \u8fdb\u7a0bPID\u6587\u4ef6\u8def\u5f84<\/span><br \/>\n<span class=\"token assign-left variable\">PID_FILE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">${LOG_DIR}<\/span>\/apollo.pid&#034;<\/span><br \/>\n<span class=\"token comment\"># &#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;&#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;<\/span><\/p>\n<p><span class=\"token comment\"># \u786e\u4fdd\u65e5\u5fd7\u76ee\u5f55\u5b58\u5728<\/span><br \/>\n<span class=\"token function\">mkdir<\/span> -p <span class=\"token variable\">${LOG_DIR}<\/span><br \/>\n<span class=\"token comment\"># \u65e5\u5fd7\u6587\u4ef6<\/span><br \/>\n<span class=\"token assign-left variable\">LOG_FILE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">${LOG_DIR}<\/span>\/apollo.out&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u989c\u8272\u8f93\u51fa\u51fd\u6570&#xff08;\u53ef\u9009&#xff0c;\u63d0\u5347\u53ef\u8bfb\u6027&#xff09;<\/span><br \/>\n<span class=\"token function-name function\">red_echo<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token builtin class-name\">echo<\/span> -e <span class=\"token string\">&#034;<span class=\"token entity\" title=\"\\\\033\">\\\\033<\/span>[31m<span class=\"token variable\">$1<\/span><span class=\"token entity\" title=\"\\\\033\">\\\\033<\/span>[0m&#034;<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token function-name function\">green_echo<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token builtin class-name\">echo<\/span> -e <span class=\"token string\">&#034;<span class=\"token entity\" title=\"\\\\033\">\\\\033<\/span>[32m<span class=\"token variable\">$1<\/span><span class=\"token entity\" title=\"\\\\033\">\\\\033<\/span>[0m&#034;<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token function-name function\">yellow_echo<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token builtin class-name\">echo<\/span> -e <span class=\"token string\">&#034;<span class=\"token entity\" title=\"\\\\033\">\\\\033<\/span>[33m<span class=\"token variable\">$1<\/span><span class=\"token entity\" title=\"\\\\033\">\\\\033<\/span>[0m&#034;<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5Java\u73af\u5883<\/span><br \/>\n<span class=\"token function-name function\">check_java<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> -n <span class=\"token string\">&#034;<span class=\"token variable\">${JAVA_HOME}<\/span>&#034;<\/span> <span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token punctuation\">[<\/span> -x <span class=\"token string\">&#034;<span class=\"token variable\">${JAVA_HOME}<\/span>\/bin\/java&#034;<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n        <span class=\"token assign-left variable\">JAVACMD<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">${JAVA_HOME}<\/span>\/bin\/java&#034;<\/span><br \/>\n    <span class=\"token keyword\">else<\/span><br \/>\n        <span class=\"token assign-left variable\">JAVACMD<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">which<\/span> java <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span>\/dev\/null<span class=\"token variable\">)<\/span><\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> -z <span class=\"token string\">&#034;<span class=\"token variable\">${JAVACMD}<\/span>&#034;<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n            red_echo <span class=\"token string\">&#034;\u9519\u8bef&#xff1a;\u672a\u627e\u5230Java\u73af\u5883&#xff0c;\u8bf7\u914d\u7f6eJAVA_HOME\u6216\u786e\u4fddjava\u547d\u4ee4\u5728PATH\u4e2d&#xff01;&#034;<\/span><br \/>\n            <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n        <span class=\"token keyword\">fi<\/span><br \/>\n        yellow_echo <span class=\"token string\">&#034;\u8b66\u544a&#xff1a;\u672a\u914d\u7f6eJAVA_HOME&#xff0c;\u4f7f\u7528\u7cfb\u7edf\u9ed8\u8ba4java: <span class=\"token variable\">${JAVACMD}<\/span>&#034;<\/span><br \/>\n    <span class=\"token keyword\">fi<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5Apollo\u76ee\u5f55<\/span><br \/>\n<span class=\"token function-name function\">check_apollo<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token operator\">!<\/span> -d <span class=\"token string\">&#034;<span class=\"token variable\">${APOLLO_HOME}<\/span>&#034;<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n        red_echo <span class=\"token string\">&#034;\u9519\u8bef&#xff1a;APOLLO_HOME\u8def\u5f84\u4e0d\u5b58\u5728&#xff1a;<span class=\"token variable\">${APOLLO_HOME}<\/span>&#034;<\/span><br \/>\n        <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n    <span class=\"token keyword\">fi<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token operator\">!<\/span> -d <span class=\"token string\">&#034;<span class=\"token variable\">${APOLLO_BASE}<\/span>&#034;<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n        red_echo <span class=\"token string\">&#034;\u9519\u8bef&#xff1a;Broker\u5b9e\u4f8b\u76ee\u5f55\u4e0d\u5b58\u5728&#xff0c;\u8bf7\u5148\u6267\u884c .\/apollo create mybroker \u521b\u5efa\u5b9e\u4f8b&#xff01;&#034;<\/span><br \/>\n        <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n    <span class=\"token keyword\">fi<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># \u542f\u52a8\u51fd\u6570&#xff08;\u524d\u53f0\/\u540e\u53f0&#xff09;<\/span><br \/>\n<span class=\"token function-name function\">start<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\"># \u5148\u68c0\u67e5\u73af\u5883<\/span><br \/>\n    check_java<br \/>\n    check_apollo<\/p>\n<p>    <span class=\"token comment\"># \u68c0\u67e5\u662f\u5426\u5df2\u8fd0\u884c<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> -f <span class=\"token string\">&#034;<span class=\"token variable\">${PID_FILE}<\/span>&#034;<\/span> <span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">ps<\/span> -p <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">cat<\/span> $<span class=\"token punctuation\">{<\/span>PID_FILE<span class=\"token punctuation\">}<\/span><span class=\"token variable\">)<\/span><\/span> <span class=\"token operator\">&gt;<\/span>\/dev\/null <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n        yellow_echo <span class=\"token string\">&#034;Apollo\u5df2\u5728\u8fd0\u884c\u4e2d&#xff08;PID: <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">cat<\/span> $<span class=\"token punctuation\">{<\/span>PID_FILE<span class=\"token punctuation\">}<\/span><span class=\"token variable\">)<\/span><\/span>&#xff09;&#034;<\/span><br \/>\n        <span class=\"token builtin class-name\">return<\/span> <span class=\"token number\">0<\/span><br \/>\n    <span class=\"token keyword\">fi<\/span><\/p>\n<p>    <span class=\"token comment\"># \u7ec4\u88c5\u5b8c\u6574JVM\u53c2\u6570&#xff08;\u548cWindows\u7248apollo.cmd\u903b\u8f91\u4e00\u81f4&#xff09;<\/span><br \/>\n    <span class=\"token assign-left variable\">FULL_JVM_FLAGS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">${JVM_FLAGS}<\/span>&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u5f00\u542fJMX\u8fdc\u7a0b\u7ba1\u7406&#xff08;\u53ef\u9009&#xff09;<\/span><br \/>\n    <span class=\"token assign-left variable\">FULL_JVM_FLAGS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">${FULL_JVM_FLAGS}<\/span> -Dcom.sun.management.jmxremote&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u7ed1\u5b9aApollo\u8def\u5f84<\/span><br \/>\n    <span class=\"token assign-left variable\">FULL_JVM_FLAGS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">${FULL_JVM_FLAGS}<\/span> -Dapollo.home&#061;<span class=\"token variable\">${APOLLO_HOME}<\/span>&#034;<\/span><br \/>\n    <span class=\"token assign-left variable\">FULL_JVM_FLAGS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">${FULL_JVM_FLAGS}<\/span> -Dapollo.base&#061;<span class=\"token variable\">${APOLLO_BASE}<\/span>&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u7c7b\u8def\u5f84<\/span><br \/>\n    <span class=\"token assign-left variable\">FULL_JVM_FLAGS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">${FULL_JVM_FLAGS}<\/span> -classpath <span class=\"token variable\">${APOLLO_HOME}<\/span>\/lib\/apollo-boot.jar&#034;<\/span><\/p>\n<p>    <span class=\"token comment\"># \u6838\u5fc3\u542f\u52a8\u547d\u4ee4&#xff08;\u548cWindows\u7248\u7684Java\u8c03\u7528\u903b\u8f91\u5b8c\u5168\u5bf9\u5e94&#xff09;<\/span><br \/>\n    <span class=\"token assign-left variable\">BOOT_CMD<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;<span class=\"token variable\">${JAVACMD}<\/span> <span class=\"token variable\">${FULL_JVM_FLAGS}<\/span> org.apache.activemq.apollo.boot.Apollo <span class=\"token variable\">${APOLLO_HOME}<\/span>\/lib org.apache.activemq.apollo.cli.Apollo run&#034;<\/span><\/p>\n<p>    green_echo <span class=\"token string\">&#034;\u5f00\u59cb\u542f\u52a8Apollo&#8230;&#034;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$1<\/span>&#034;<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;foreground&#034;<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n        <span class=\"token comment\"># \u524d\u53f0\u542f\u52a8&#xff08;\u8c03\u8bd5\u7528&#xff0c;\u65e5\u5fd7\u8f93\u51fa\u5230\u7ec8\u7aef&#xff09;<\/span><br \/>\n        <span class=\"token variable\">${BOOT_CMD}<\/span><br \/>\n    <span class=\"token keyword\">else<\/span><br \/>\n        <span class=\"token comment\"># \u540e\u53f0\u542f\u52a8&#xff08;\u751f\u4ea7\u7528&#xff0c;\u65e5\u5fd7\u8f93\u51fa\u5230\u6587\u4ef6&#xff09;<\/span><br \/>\n        <span class=\"token function\">nohup<\/span> <span class=\"token variable\">${BOOT_CMD}<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token variable\">${LOG_FILE}<\/span> <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span> <span class=\"token operator\">&amp;<\/span><br \/>\n        <span class=\"token builtin class-name\">echo<\/span> <span class=\"token variable\">$!<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token variable\">${PID_FILE}<\/span><br \/>\n        <span class=\"token function\">sleep<\/span> <span class=\"token number\">3<\/span><br \/>\n        <span class=\"token comment\"># \u68c0\u67e5\u542f\u52a8\u7ed3\u679c<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token function\">ps<\/span> -p <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">cat<\/span> $<span class=\"token punctuation\">{<\/span>PID_FILE<span class=\"token punctuation\">}<\/span><span class=\"token variable\">)<\/span><\/span> <span class=\"token operator\">&gt;<\/span>\/dev\/null <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n            green_echo <span class=\"token string\">&#034;Apollo\u542f\u52a8\u6210\u529f&#xff01;PID: <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">cat<\/span> $<span class=\"token punctuation\">{<\/span>PID_FILE<span class=\"token punctuation\">}<\/span><span class=\"token variable\">)<\/span><\/span>&#xff0c;\u65e5\u5fd7\u6587\u4ef6&#xff1a;<span class=\"token variable\">${LOG_FILE}<\/span>&#034;<\/span><br \/>\n        <span class=\"token keyword\">else<\/span><br \/>\n            red_echo <span class=\"token string\">&#034;Apollo\u542f\u52a8\u5931\u8d25&#xff01;\u8bf7\u67e5\u770b\u65e5\u5fd7&#xff1a;<span class=\"token variable\">${LOG_FILE}<\/span>&#034;<\/span><br \/>\n            <span class=\"token function\">rm<\/span> -f <span class=\"token variable\">${PID_FILE}<\/span><br \/>\n            <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n        <span class=\"token keyword\">fi<\/span><br \/>\n    <span class=\"token keyword\">fi<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># \u505c\u6b62\u51fd\u6570<\/span><br \/>\n<span class=\"token function-name function\">stop<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token operator\">!<\/span> -f <span class=\"token string\">&#034;<span class=\"token variable\">${PID_FILE}<\/span>&#034;<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n        yellow_echo <span class=\"token string\">&#034;Apollo\u672a\u8fd0\u884c&#xff08;PID\u6587\u4ef6\u4e0d\u5b58\u5728&#xff09;&#034;<\/span><br \/>\n        <span class=\"token builtin class-name\">return<\/span> <span class=\"token number\">0<\/span><br \/>\n    <span class=\"token keyword\">fi<\/span><\/p>\n<p>    <span class=\"token assign-left variable\">PID<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">cat<\/span> $<span class=\"token punctuation\">{<\/span>PID_FILE<span class=\"token punctuation\">}<\/span><span class=\"token variable\">)<\/span><\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token function\">ps<\/span> -p <span class=\"token variable\">${PID}<\/span> <span class=\"token operator\">&gt;<\/span>\/dev\/null <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n        green_echo <span class=\"token string\">&#034;\u6b63\u5728\u505c\u6b62Apollo&#xff08;PID: <span class=\"token variable\">${PID}<\/span>&#xff09;&#8230;&#034;<\/span><br \/>\n        <span class=\"token function\">kill<\/span> <span class=\"token variable\">${PID}<\/span><br \/>\n        <span class=\"token comment\"># \u7b49\u5f85\u8fdb\u7a0b\u9000\u51fa<\/span><br \/>\n        <span class=\"token function\">sleep<\/span> <span class=\"token number\">5<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token function\">ps<\/span> -p <span class=\"token variable\">${PID}<\/span> <span class=\"token operator\">&gt;<\/span>\/dev\/null <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n            red_echo <span class=\"token string\">&#034;\u4f18\u96c5\u505c\u6b62\u5931\u8d25&#xff0c;\u5f3a\u5236\u6740\u6b7b\u8fdb\u7a0b&#8230;&#034;<\/span><br \/>\n            <span class=\"token function\">kill<\/span> -9 <span class=\"token variable\">${PID}<\/span><br \/>\n        <span class=\"token keyword\">fi<\/span><br \/>\n        <span class=\"token function\">rm<\/span> -f <span class=\"token variable\">${PID_FILE}<\/span><br \/>\n        green_echo <span class=\"token string\">&#034;Apollo\u5df2\u505c\u6b62&#034;<\/span><br \/>\n    <span class=\"token keyword\">else<\/span><br \/>\n        yellow_echo <span class=\"token string\">&#034;Apollo\u672a\u8fd0\u884c&#xff08;PID: <span class=\"token variable\">${PID}<\/span> \u4e0d\u5b58\u5728&#xff09;&#034;<\/span><br \/>\n        <span class=\"token function\">rm<\/span> -f <span class=\"token variable\">${PID_FILE}<\/span><br \/>\n    <span class=\"token keyword\">fi<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># \u72b6\u6001\u67e5\u8be2<\/span><br \/>\n<span class=\"token function-name function\">status<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> -f <span class=\"token string\">&#034;<span class=\"token variable\">${PID_FILE}<\/span>&#034;<\/span> <span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">ps<\/span> -p <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">cat<\/span> $<span class=\"token punctuation\">{<\/span>PID_FILE<span class=\"token punctuation\">}<\/span><span class=\"token variable\">)<\/span><\/span> <span class=\"token operator\">&gt;<\/span>\/dev\/null <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n        green_echo <span class=\"token string\">&#034;Apollo\u6b63\u5728\u8fd0\u884c\u4e2d&#xff01;PID: <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">cat<\/span> $<span class=\"token punctuation\">{<\/span>PID_FILE<span class=\"token punctuation\">}<\/span><span class=\"token variable\">)<\/span><\/span>&#034;<\/span><br \/>\n    <span class=\"token keyword\">else<\/span><br \/>\n        red_echo <span class=\"token string\">&#034;Apollo\u672a\u8fd0\u884c&#034;<\/span><br \/>\n    <span class=\"token keyword\">fi<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># \u5e2e\u52a9\u4fe1\u606f<\/span><br \/>\n<span class=\"token function-name function\">usage<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u7528\u6cd5&#xff1a;<span class=\"token variable\">$0<\/span> [\u547d\u4ee4]&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u652f\u6301\u7684\u547d\u4ee4&#xff1a;&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;  start      &#8211; \u540e\u53f0\u542f\u52a8Apollo&#xff08;\u751f\u4ea7\u73af\u5883\u63a8\u8350&#xff09;&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;  start-fg   &#8211; \u524d\u53f0\u542f\u52a8Apollo&#xff08;\u8c03\u8bd5\u7528&#xff0c;\u65e5\u5fd7\u8f93\u51fa\u5230\u7ec8\u7aef&#xff09;&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;  stop       &#8211; \u505c\u6b62Apollo&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;  restart    &#8211; \u91cd\u542fApollo&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;  status     &#8211; \u67e5\u770bApollo\u8fd0\u884c\u72b6\u6001&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;  help       &#8211; \u663e\u793a\u5e2e\u52a9\u4fe1\u606f&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># \u4e3b\u903b\u8f91<\/span><br \/>\n<span class=\"token keyword\">case<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$1<\/span>&#034;<\/span> <span class=\"token keyword\">in<\/span><br \/>\n    start<span class=\"token punctuation\">)<\/span><br \/>\n        start<br \/>\n        <span class=\"token punctuation\">;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    start-fg<span class=\"token punctuation\">)<\/span><br \/>\n        start foreground<br \/>\n        <span class=\"token punctuation\">;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    stop<span class=\"token punctuation\">)<\/span><br \/>\n        stop<br \/>\n        <span class=\"token punctuation\">;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    restart<span class=\"token punctuation\">)<\/span><br \/>\n        stop<br \/>\n        <span class=\"token function\">sleep<\/span> <span class=\"token number\">2<\/span><br \/>\n        start<br \/>\n        <span class=\"token punctuation\">;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    status<span class=\"token punctuation\">)<\/span><br \/>\n        status<br \/>\n        <span class=\"token punctuation\">;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token builtin class-name\">help<\/span><span class=\"token operator\">|<\/span>*<span class=\"token punctuation\">)<\/span><br \/>\n        usage<br \/>\n        <span class=\"token punctuation\">;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">esac<\/span><\/p>\n<p><span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">0<\/span><\/p>\n<p>\u4e09\u6b65\u9a8c\u8bc1\u670d\u52a1\u53ef\u7528\u6027<\/p>\n<li>\u7ba1\u7406\u540e\u53f0&#xff1a;\u6d4f\u89c8\u5668\u8bbf\u95ee http:\/\/Linux\u670d\u52a1\u5668IP:61680&#xff0c;\u7528\u9ed8\u8ba4\u8d26\u53f7 admin\/password \u767b\u5f55&#xff08;\u548c Windows \u7aef\u4e00\u81f4&#xff09;&#xff1b;<\/li>\n<li>MQTT \u8fde\u63a5&#xff1a;\u7528 MQTTX \u7b49\u5de5\u5177&#xff0c;\u8fde\u63a5 tcp:\/\/Linux\u670d\u52a1\u5668IP:61613&#xff0c;\u53d1\u4e00\u6761\u6d4b\u8bd5\u6d88\u606f&#xff0c;\u80fd\u6536\u5230\u5219\u6b63\u5e38&#xff1b;<\/li>\n<li>\u6570\u636e\u5b8c\u6574\u6027&#xff1a;\u5728\u7ba1\u7406\u540e\u53f0\u67e5\u770b \u201c\u961f\u5217 \/ \u4e3b\u9898\u201d&#xff0c;\u548c Windows \u7aef\u7684\u6570\u91cf\u3001\u540d\u79f0\u4e00\u81f4&#xff0c;\u8bf4\u660e\u6570\u636e\u8fc1\u79fb\u6210\u529f\u3002<\/li>\n<h3>\u516d\u3001\u6536\u5c3e&#xff1a;\u751f\u4ea7\u73af\u5883\u4f18\u5316<\/h3>\n<li>\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<br \/>\n\u907f\u514d\u670d\u52a1\u5668\u91cd\u542f\u540e\u670d\u52a1\u6302\u6389&#xff0c;\u628a Apollo \u6ce8\u518c\u4e3a\u7cfb\u7edf\u670d\u52a1&#xff1a;<\/li>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">ln<\/span> -s \/home\/apollo\/apache-apollo-1.7.1\/bin\/mybroker\/bin\/apollo-broker-service \/etc\/init.d\/<br \/>\n<span class=\"token function\">sudo<\/span> update-rc.d apollo-broker-service defaults<\/p>\n<li>\u5173\u95ed Windows \u7aef\u670d\u52a1<br \/>\n\u786e\u8ba4 Linux \u7aef\u5b8c\u5168\u6b63\u5e38\u540e&#xff0c;\u5f7b\u5e95\u5173\u6389 Windows \u7aef\u7684 Apollo&#xff0c;\u907f\u514d\u7aef\u53e3\u51b2\u7a81\u3002<\/li>\n<h3>\u4e03\u3001\u907f\u5751\u624b\u518c&#xff1a;\u5e38\u89c1\u95ee\u9898\u89e3\u51b3<\/h3>\n<table>\n<tr>\u95ee\u9898\u73b0\u8c61\u539f\u56e0 &#043; \u89e3\u51b3\u65b9\u6cd5<\/tr>\n<tbody>\n<tr>\n<td>\u542f\u52a8\u5931\u8d25&#xff0c;\u65e5\u5fd7\u62a5 \u201c\u6743\u9650\u4e0d\u8db3\u201d<\/td>\n<td>Linux \u6743\u9650\u95ee\u9898 \u2192 \u6267\u884c chmod -R 755 mybroker<\/td>\n<\/tr>\n<tr>\n<td>\u7ba1\u7406\u540e\u53f0\u6253\u4e0d\u5f00<\/td>\n<td>\u9632\u706b\u5899\u6ca1\u5f00 61680 \u7aef\u53e3 \u2192 sudo firewall-cmd &#8211;add-port&#061;61680\/tcp &#8211;permanent<\/td>\n<\/tr>\n<tr>\n<td>MQTT \u8fde\u4e0d\u4e0a<\/td>\n<td>61613 \u7aef\u53e3\u6ca1\u5f00\u653e \u2192 \u5f00\u653e\u7aef\u53e3&#xff0c;\u6216\u68c0\u67e5 apollo.xml \u7aef\u53e3\u914d\u7f6e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u603b\u7ed3<br \/>\nApollo \u8de8\u7cfb\u7edf\u8fc1\u79fb\u7684\u6838\u5fc3\u903b\u8f91\u662f \u201c\u590d\u5236\u5b9e\u4f8b\u6587\u4ef6 &#043; \u9002\u914d Linux \u73af\u5883\u201d&#xff0c;\u53ea\u8981\u6ce8\u610f \u201c\u6743\u9650\u201d\u201c\u8def\u5f84\u201d \u8fd9\u4e24\u4e2a\u5751&#xff0c;\u57fa\u672c\u80fd\u4e00\u6b21\u6210\u529f\u3002<br \/>\n\u5982\u679c\u4f60\u4e5f\u5728\u505a\u6d88\u606f\u4e2d\u95f4\u4ef6\u7684\u8de8\u7cfb\u7edf\u8fc1\u79fb&#xff0c;\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u4ea4\u6d41\u8e29\u8fc7\u7684\u5751&#xff5e;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f&#xff1a;\u4f5c\u4e3a\u8f7b\u91cf\u7ea7\u6d88\u606f\u4e2d\u95f4\u4ef6&#xff0c;Apache Apollo \u5e38\u88ab\u7528\u4e8e MQTT \u534f\u8bae\u7684\u6d88\u606f\u901a\u4fe1\u573a\u666f\u3002\u4f46\u5b9e\u9645\u90e8\u7f72\u4e2d&#xff0c;\u4e0d\u5c11\u540c\u5b66\u4f1a\u9047\u5230\u4ece Windows \u6d4b\u8bd5\u73af\u5883\u8fc1\u79fb\u5230 Linux \u751f\u4ea7\u73af\u5883\u7684\u9700\u6c42 \u2014\u2014 \u8fd9\u8fc7\u7a0b\u770b\u4f3c\u7b80\u5355&#xff0c;\u5374\u5bb9\u6613\u8e29 \u201c\u8def\u5f84\u517c\u5bb9\u201d\u201c\u6743\u9650\u201d\u201c\u6570\u636e\u5b8c\u6574\u6027\u201d \u7684\u5751\u3002<br \/>\n\u672c\u6587\u5c31\u5e26\u4f60\u8d70\u5b8c Apollo \u8de8\u7cfb\u7edf\u8fc1\u79fb\u7684\u5168\u6d41\u7a0b&#xff0c;\u4ece\u73af\u5883\u51c6\u5907\u5230\u670d\u52a1\u9a8c\u8bc1&#xff0c;\u4e00\u6b21\u641e\u5b9a&#xff01;<br \/>\n\u4e00\u3001\u8fc1\u79fb\u524d\u5fc5\u77e5&#xff1a;\u6838\u5fc3<\/p>\n","protected":false},"author":2,"featured_media":69163,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[331,149,43],"topic":[],"class_list":["post-69165","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-apache","tag-windows","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u5b9e\u64cd\u6307\u5357\u3011Apache Apollo \u4ece Windows \u8fc1\u79fb\u81f3 Linux \u670d\u52a1\u5668\u5168\u6d41\u7a0b\uff08\u9644\u907f\u5751\u624b\u518c\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\/69165.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u5b9e\u64cd\u6307\u5357\u3011Apache Apollo \u4ece Windows \u8fc1\u79fb\u81f3 Linux \u670d\u52a1\u5668\u5168\u6d41\u7a0b\uff08\u9644\u907f\u5751\u624b\u518c\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u80cc\u666f&#xff1a;\u4f5c\u4e3a\u8f7b\u91cf\u7ea7\u6d88\u606f\u4e2d\u95f4\u4ef6&#xff0c;Apache Apollo \u5e38\u88ab\u7528\u4e8e MQTT \u534f\u8bae\u7684\u6d88\u606f\u901a\u4fe1\u573a\u666f\u3002\u4f46\u5b9e\u9645\u90e8\u7f72\u4e2d&#xff0c;\u4e0d\u5c11\u540c\u5b66\u4f1a\u9047\u5230\u4ece Windows \u6d4b\u8bd5\u73af\u5883\u8fc1\u79fb\u5230 Linux \u751f\u4ea7\u73af\u5883\u7684\u9700\u6c42 \u2014\u2014 \u8fd9\u8fc7\u7a0b\u770b\u4f3c\u7b80\u5355&#xff0c;\u5374\u5bb9\u6613\u8e29 \u201c\u8def\u5f84\u517c\u5bb9\u201d\u201c\u6743\u9650\u201d\u201c\u6570\u636e\u5b8c\u6574\u6027\u201d \u7684\u5751\u3002 \u672c\u6587\u5c31\u5e26\u4f60\u8d70\u5b8c Apollo \u8de8\u7cfb\u7edf\u8fc1\u79fb\u7684\u5168\u6d41\u7a0b&#xff0c;\u4ece\u73af\u5883\u51c6\u5907\u5230\u670d\u52a1\u9a8c\u8bc1&#xff0c;\u4e00\u6b21\u641e\u5b9a&#xff01; \u4e00\u3001\u8fc1\u79fb\u524d\u5fc5\u77e5&#xff1a;\u6838\u5fc3\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/69165.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-30T23:41:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260130234125-697d41a5d0545.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=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/69165.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/69165.html\",\"name\":\"\u3010\u5b9e\u64cd\u6307\u5357\u3011Apache Apollo \u4ece Windows \u8fc1\u79fb\u81f3 Linux \u670d\u52a1\u5668\u5168\u6d41\u7a0b\uff08\u9644\u907f\u5751\u624b\u518c\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-30T23:41:27+00:00\",\"dateModified\":\"2026-01-30T23:41:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/69165.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/69165.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/69165.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u5b9e\u64cd\u6307\u5357\u3011Apache Apollo \u4ece Windows \u8fc1\u79fb\u81f3 Linux \u670d\u52a1\u5668\u5168\u6d41\u7a0b\uff08\u9644\u907f\u5751\u624b\u518c\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":"\u3010\u5b9e\u64cd\u6307\u5357\u3011Apache Apollo \u4ece Windows \u8fc1\u79fb\u81f3 Linux \u670d\u52a1\u5668\u5168\u6d41\u7a0b\uff08\u9644\u907f\u5751\u624b\u518c\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\/69165.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u5b9e\u64cd\u6307\u5357\u3011Apache Apollo \u4ece Windows \u8fc1\u79fb\u81f3 Linux \u670d\u52a1\u5668\u5168\u6d41\u7a0b\uff08\u9644\u907f\u5751\u624b\u518c\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u80cc\u666f&#xff1a;\u4f5c\u4e3a\u8f7b\u91cf\u7ea7\u6d88\u606f\u4e2d\u95f4\u4ef6&#xff0c;Apache Apollo \u5e38\u88ab\u7528\u4e8e MQTT \u534f\u8bae\u7684\u6d88\u606f\u901a\u4fe1\u573a\u666f\u3002\u4f46\u5b9e\u9645\u90e8\u7f72\u4e2d&#xff0c;\u4e0d\u5c11\u540c\u5b66\u4f1a\u9047\u5230\u4ece Windows \u6d4b\u8bd5\u73af\u5883\u8fc1\u79fb\u5230 Linux \u751f\u4ea7\u73af\u5883\u7684\u9700\u6c42 \u2014\u2014 \u8fd9\u8fc7\u7a0b\u770b\u4f3c\u7b80\u5355&#xff0c;\u5374\u5bb9\u6613\u8e29 \u201c\u8def\u5f84\u517c\u5bb9\u201d\u201c\u6743\u9650\u201d\u201c\u6570\u636e\u5b8c\u6574\u6027\u201d \u7684\u5751\u3002 \u672c\u6587\u5c31\u5e26\u4f60\u8d70\u5b8c Apollo \u8de8\u7cfb\u7edf\u8fc1\u79fb\u7684\u5168\u6d41\u7a0b&#xff0c;\u4ece\u73af\u5883\u51c6\u5907\u5230\u670d\u52a1\u9a8c\u8bc1&#xff0c;\u4e00\u6b21\u641e\u5b9a&#xff01; \u4e00\u3001\u8fc1\u79fb\u524d\u5fc5\u77e5&#xff1a;\u6838\u5fc3","og_url":"https:\/\/www.wsisp.com\/helps\/69165.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-30T23:41:27+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260130234125-697d41a5d0545.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/69165.html","url":"https:\/\/www.wsisp.com\/helps\/69165.html","name":"\u3010\u5b9e\u64cd\u6307\u5357\u3011Apache Apollo \u4ece Windows \u8fc1\u79fb\u81f3 Linux \u670d\u52a1\u5668\u5168\u6d41\u7a0b\uff08\u9644\u907f\u5751\u624b\u518c\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-30T23:41:27+00:00","dateModified":"2026-01-30T23:41:27+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/69165.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/69165.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/69165.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u5b9e\u64cd\u6307\u5357\u3011Apache Apollo \u4ece Windows \u8fc1\u79fb\u81f3 Linux \u670d\u52a1\u5668\u5168\u6d41\u7a0b\uff08\u9644\u907f\u5751\u624b\u518c\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\/69165","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=69165"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/69165\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/69163"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=69165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=69165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=69165"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=69165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}