mkdir -p /opt/model
- 上传安装包/解压
tar -xzvf apache-activemq-5.14.3-bin.tar.gz -C /opt/model
cd /etc/init.d/
vim activemq
注意:将下面内容全部复制。 要先安装jdk,在下面配置jdk的安装目录。
#!/bin/sh # # /etc/init.d/activemq # chkconfig: 345 63 37 # description: activemq servlet container. # processname: activemq 5.14.3 # Source function library. #. /etc/init.d/functions # source networking configuration. #. /etc/sysconfig/network export JAVA_HOME=/usr/local/jdk1.8 export CATALINA_HOME=/usr/local/apache-activemq-5.16.0 case $1 in start) sh $CATALINA_HOME/bin/activemq start ;; stop) sh $CATALINA_HOME/bin/activemq stop ;; restart) sh $CATALINA_HOME/bin/activemq stop sleep 1 sh $CATALINA_HOME/bin/activemq start ;; esac exit 0
chmod 777 activemq
- 设置开机启动
# 设置开机启动 chkconfig activemq on # 启动ActiveMQ service activemq start
<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start"> <!--<property name="host" value="127.0.0.1"/>--> <property name="host" value="192.168.126.133"/> <property name="port" value="8161"/> </bean>
service activemq status # 关闭activemq服务 service activemq stop
1.3、启动时指定日志输出文件
# 启动时指定日志输出文件 service activemq start > /usr/local/activemq.log
# 方式1:查看进程 ps -ef|grep activemq |grep -v grep # 方式2:查看端口 netstat -app|grep 61616 # 方式3:查看端口是否被占用 lsof -i:61616
二、ActiveMQ控制台
2.1、访问activemq管理页
访问activemq管理页面地址:http://IP地址:8161/
账户admin 密码admin