centos7安装activemq

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代码测试

 

转载于:https://www.cnblogs.com/ystq/p/5973573.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值