二、ActiveMQ安装

一、ActiveMQ安装

1.1、官方下载

  官网地址: https://activemq.apache.org/download-archives

1.2、安装步骤

  安装:http://blog.csdn.net/gebitan505/article/details/55096222

mkdir -p /usr/local/activemq  && tar -xzvf ~/apache-activemq-5.14.3-bin.tar.gz -C  /usr/local/activemq  --strip-components 1
  • 在/etc/init.d/目录增加增加activemq文件
 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/jdk
export CATALINA_HOME=/usr/local/activemq

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
  • 如果是远程访问需要修改jetty.xml。关闭防火墙。
<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>

  访问activemq管理页面地址:http://IP地址:8161/。账户admin  密码admin

  • 查看activemq状态
service activemq status
# 关闭activemq服务
service activemq stop
  • 因为主机名不符合规范导致无法启动activemq

   https://blog.csdn.net/qq_39056805/article/details/80749337

1.3、启动时指定日志输出文件

 # 启动时指定日志输出文件
 service activemq start  >  /usr/local/activemq.log

1.4、查看程序启动是否成功的3种方式

# 方式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

2.2、进入

 

posted @ 2021-01-05 22:14  jingdy  阅读(177)  评论(0编辑  收藏  举报