ActiveMQ 的安裝

  1. ActiveMQ下載 

    下載ActiveMQ5.14.0 或者 Linux下執行java

    $ wget http://apache.fayea.com//activemq/5.14.0/apache-activemq-5.14.0-bin.tar.gz
  2. 解壓安裝

    解壓並重命名linux

    $ tar -zxvf apache-activemq-5.14.0-bin.tar.gz
    $ mv apache-activemq-5.14.0 activemq-01

    若是 activemq-01/bin/activemq 沒有可執行權限,須要對齊進行受權web

    $ cd activemq-01/bin/
    $ chmod 755 ./activemq
  3.  防火牆中打開對應的端口(ActiveMQ 須要用到兩個端口)

    • 消息通信的端口(默認爲 61616)
    • 管理控制檯端口(默認爲 8161),其端口能夠在 conf/jetty.xml 中修改
      <bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
      <!-- the default port number for the web console -->
      <property name="host" value="0.0.0.0"/>
      <property name="port" value="8161"/>
      </bean>

       

     編輯iptables文件(若是Centos7中未安裝iptables 、能夠參照linux環境下zookeeper部署中的安裝)apache

    vi /etc/sysconfig/iptables

     增長端口配置bash

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 61616 -j ACCEPT
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 8161 -j ACCEP

     重啓防火牆tcp

    systemctl restart iptables.service
  4. 啓動ActiveMQ

    $ cd /home/longload/activemq-01/bin
    $ ./activemq start

    出現下列命令啓動成功spa

    INFO: Loading '/home/longload/activemq-01//bin/env'
    INFO: Using java '/opt/java/jdk1.7.0_79/bin/java'
    INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
    INFO: pidfile created : '/home/longload/activemq-01//data/activemq.pid' (pid '62416')
  5. 查看管理界面 http://192.168.48.129:8161/

  6. 設置開機啓動

    $ vi /etc/rc.local

    加入如下內容.net

    ## ActiveMQ
    su - longload -c '/home/longload/activemq-01/bin/activemq start'
相關文章
相關標籤/搜索