centos7安装activemq

纵然是瞬间 提交于 2020-03-14 02:20:46

activemq下载地址,http://activemq.apache.org/download.html,下载后解压,进入bin,直接运行 activemq start

bin/activemq start
INFO: Loading '/usr/local/activemq/bin/env'
INFO: Using java '/usr/local/jdk8/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: pidfile created : '/usr/local/activemq/data/activemq.pid' (pid '3880')

默认端口是61616,可以查看端口有没被占用

[root@localhost init.d]# netstat -an|grep 61616
tcp6       0      0 :::61616                :::*                    LISTEN 

端口61616加入防火墙,后台管理端口8161也加入防火墙

firewall-cmd --zone=public --add-port=61616/tcp --permanent
firewall-cmd --zone=public --add-port=8161/tcp --permanent
firewall-cmd --reload

浏览器 访问http://192.168.249.71:8161/admin/,用户名/密码:admin/admin

把activemq加入系统服务并开机自启动cp /usr/local/activemq/bin/activemq /etc/init.d/activemqd

cd /etc/init.d/

vi activemqd

在#!/bin/sh下面添加以下代码

#### BEGIN INIT INFO
# Provides:             activemq
# Required-Start:       $remote_fs $syslog
# Required-Stop:        $remote_fs $syslog
# Default-Start:        2 3 4 5
# Default-Stop:         0 6
# chkconfig: 2345 64 36
# Short-Description:    ActiveMQ server
### END INIT INFO
export JAVA_HOME=/usr/local/jdk7#根据实际情况设置
ACTIVEMQ_HOME=/usr/local/activemq#根据实际情况设置

  

 


#加入系统服务并开机启动chmod +x activemqd
chkconfig --add activemqd
chkconfig activemqd on
[root@localhost init.d]# service activemqd start
INFO: Loading '/usr/local/activemq/bin/env'
INFO: Using java '/usr/local/jdk8/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: pidfile created : '/usr/local/activemq/data/activemq.pid' (pid '4057')

java代码测试

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!