下载ActiveMQ5.14.0 或者 Linux下执行java
$ wget http://apache.fayea.com//activemq/5.14.0/apache-activemq-5.14.0-bin.tar.gz
解压并重命名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
<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
$ 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')
$ vi /etc/rc.local
加入如下内容.net
## ActiveMQ su - longload -c '/home/longload/activemq-01/bin/activemq start'