{"id":125,"date":"2024-02-24T16:51:37","date_gmt":"2024-02-24T08:51:37","guid":{"rendered":"http:\/\/esufy.com\/?p=125"},"modified":"2024-03-10T15:39:36","modified_gmt":"2024-03-10T07:39:36","slug":"linux%e5%ae%89%e8%a3%85%e9%83%a8%e7%bd%b2activemq","status":"publish","type":"post","link":"http:\/\/www.esufy.cn\/?p=125","title":{"rendered":"linux\u5b89\u88c5\u90e8\u7f72activemq"},"content":{"rendered":"<p>1\u3001\u4e0b\u8f7d\uff1aapache-activemq-5.10.0-bin.tar.gz\uff0c\u4e0b\u8f7d\u5730\u5740\uff1ahttp:\/\/archive.apache.org\/dist\/activemq<\/p>\n<p>2\u3001\u89e3\u538b\uff1a\/data\/apache-activemq-5.10.0<\/p>\n<p>3\u3001\u542f\u52a8<br \/>\ncd \/data\/apache-activemq-5.10.0\/bin<br \/>\n.\/activemq start<\/p>\n<p>4\u3001\u8c03\u6574\u5185\u5b58\uff0c\u5185\u5b58\u5c0f\u670d\u52a1\u5668\u53ef\u8c03\u5c0f\u5185\u5b58<br \/>\n\/data\/apache-activemq-5.10.0\/bin\/activemq<br \/>\n\u627e\u5230\uff1a<br \/>\n# Set jvm memory configuration<br \/>\nif [ -z &#8220;$ACTIVEMQ_OPTS_MEMORY&#8221; ] ; then<br \/>\nACTIVEMQ_OPTS_MEMORY=&#8221;-Xms1G -Xmx1G&#8221;<br \/>\nfi<br \/>\n\u6539\u4e3a\uff1a<br \/>\n# Set jvm memory configuration<br \/>\nif [ -z &#8220;$ACTIVEMQ_OPTS_MEMORY&#8221; ] ; then<br \/>\nACTIVEMQ_OPTS_MEMORY=&#8221;-Xms512m -Xmx512m&#8221;<br \/>\nfi<\/p>\n<p>5\u3001\u95ee\u9898\u89e3\u51b3<br \/>\n(1)\u89e3\u51b3\u65e0\u6cd5\u901a\u8fc7ip\u5730\u5740\u8bbf\u95eeActiveMQ\u7ba1\u7406\u754c\u9762\u7684\u95ee\u9898<br \/>\n1)\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684host\u5730\u5740\uff08conf\/jetty.xml)<\/p>\n<p><!-- the default port number for the web console --><\/p>\n<p>\u4fee\u6539host\u5bf9\u5e94\u7684ip\u5730\u5740\u3002\u4e5f\u53ef\u4ee5\u6539\u62100.0.0.0\uff08\u521b\u5efadocker\u955c\u50cf\u7684\u65f6\u5019\u6539\u4e3a0.0.0.0\uff0c\u5426\u5219\u65e0\u6cd5\u4ece\u5916\u90e8\u6d4f\u89c8\u5668\u67e5\u770b\u6d88\u606f\u961f\u5217\uff09<\/p>\n<p>2)\u5f00\u653e\u9632\u706b\u5899\u5bf9\u5e94\u7aef\u53e3<br \/>\n\/\/8161\u662f\u7ba1\u7406\u7684\u7aef\u53e3<br \/>\nfirewall-cmd &#8211;zone=public &#8211;add-port=8161\/tcp &#8211;permanent<br \/>\n\/\/61616\u662f\u901a\u4fe1\u7684\u7aef\u53e3<br \/>\nfirewall-cmd &#8211;zone=public &#8211;add-port=61616\/tcp &#8211;permanent<br \/>\n\/\/\u91cd\u65b0\u8f7d\u5165<br \/>\nfirewall-cmd &#8211;reload<br \/>\n\/\/\u67e5\u770b\u662f\u5426\u8bbe\u7f6e\u6210\u529f<br \/>\nfirewall-cmd &#8211;zone=public &#8211;list-ports<\/p>\n<p>3)\u91cd\u542factivemq\u670d\u52a1<br \/>\n.\/activemq restart<br \/>\n\u81f3\u6b64\uff0c\u53ef\u4ee5\u5728\u5176\u4ed6\u7535\u8111\u4e0a\u901a\u8fc7http:\/\/ip:8161\u8bbf\u95ee\u5f53\u524d\u7535\u8111\u4e0a\u7684activemq\u4e86<\/p>\n<p>6\u3001\u8bbe\u7f6eactivemq\u5f00\u673a\u81ea\u542f\u52a8<br \/>\n(1)\u521b\u5efa\u811a\u672c<br \/>\nvim \/etc\/init.d\/activemq<\/p>\n<p>(2)\u7f16\u8f91\u811a\u672c(\u6ce8\u610f\u4fee\u6539JAVA_HOME\u548cMQ_HOME\u7684\u503c\uff09<br \/>\n#!\/bin\/bash<br \/>\n# chkconfig: 2345 10 90<br \/>\n# description: activemq &#8230;.<br \/>\nprog=activemq<br \/>\nJAVA_HOME=\/home\/xxxx\/SoftWare\/jdk1.8.0_40<br \/>\nexport JAVA_HOME<br \/>\nMQ_HOME=\/usr\/local\/apache-activemq-5.16.1<br \/>\nexport MQ_HOME<br \/>\ncase &#8220;$1&#8221; in<br \/>\nstart)<br \/>\necho &#8220;Starting $prog&#8230;&#8221;<br \/>\n$MQ_HOME\/bin\/activemq start<br \/>\n;;<br \/>\nstop)<br \/>\necho &#8220;Stopping $prog&#8230;&#8221;<br \/>\n$MQ_HOME\/bin\/activemq stop<br \/>\n;;<br \/>\nrestart)<br \/>\necho &#8220;Stopping $prog&#8230;&#8221;<br \/>\n$MQ_HOME\/bin\/activemq stop<br \/>\nsleep 2<br \/>\necho<br \/>\necho &#8220;Starting $prog&#8230;&#8221;<br \/>\n$MQ_HOME\/bin\/activemq start<br \/>\n;;<br \/>\n*)<br \/>\necho &#8220;Usage: $prog {start|stop|restart}&#8221;<br \/>\n;;<br \/>\nesac<br \/>\nexit<\/p>\n<p>(3)\u8d4b\u4e88\u8be5\u811a\u672c\u53ef\u6267\u884c\u6743\u9650<br \/>\nchmod +x \/etc\/init.d\/activemq<\/p>\n<p>(4)\u6dfb\u52a0\u5230\u5f00\u673a\u542f\u52a8<br \/>\nchkconfig &#8211;add activemq<br \/>\n#\u8f6f\u94fe\u63a5<br \/>\nln -s \/etc\/init.d\/activemq \/etc\/rc3.d\/activemq<\/p>\n<p>(5)\u64cd\u4f5cActiveMQ<br \/>\n# service activemq start<br \/>\n# service activemq status<br \/>\n# service activemq stop<\/p>\n<p>chkconfig\u548cservice\u547d\u4ee4\u7684\u533a\u522b<br \/>\nchkconfig\u662f\u5f53\u524d\u4e0d\u751f\u6548\uff0cLinux\u91cd\u542f\u4e4b\u540e\u624d\u751f\u6548\u7684\u547d\u4ee4(\u5f00\u673a\u81ea\u542f\u52a8\u9879)<br \/>\nservice\u662f\u5373\u4f7f\u751f\u6548\uff0c\u91cd\u542f\u540e\u5931\u6548\u7684\u547d\u4ee4<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u4e0b\u8f7d\uff1aapache-activemq-5.10.0-bin.tar.gz\uff0c\u4e0b\u8f7d\u5730\u5740\uff1ahttp:\/\/arch [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":306,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23,24],"tags":[28],"_links":{"self":[{"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/posts\/125"}],"collection":[{"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=125"}],"version-history":[{"count":1,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":126,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/posts\/125\/revisions\/126"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=\/wp\/v2\/media\/306"}],"wp:attachment":[{"href":"http:\/\/www.esufy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.esufy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}