关于activemq:activemq入门安装

1、资源筹备

1.1 环境

Centos7、jdk8、activemq5.15.8

1.2 activemq5.15.8 安装包

官网下载地址:http://activemq.apache.org/ac…

国外下载比较慢,能够通过这个网址下载:https://download.csdn.net/dow…

2、装置步骤

2.1 上传下载好的activemq安装包到/var目录并解压

tar -zxvf apache-activemq-5.15.8-bin.tar.gz -C /var 

2.2 批改目录名称

mv /var/apache-activemq-5.15.8/ /var/activemq/

2.3 做成零碎服务

2.3.1 创立一个systemd服务文件

vi  /usr/lib/systemd/system/activemq.service

2.3.2 在该文件放入以下内容

[Unit]
Description=ActiveMQ service
After=network.target

[Service]
Type=forking
ExecStart=/var/activemq/bin/activemq start
ExecStop=/var/activemq/bin/activemq stop
User=root
Group=root
Restart=always
RestartSec=9
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=activemq

[Install]
WantedBy=multi-user.target

2.3.3 找到java命令所在的目录

whereis java

2.3.4 设置activemq配置文件/var/activemq/bin/env中的JAVA_HOME

# Location of the java installation
# Specify the location of your java installation using JAVA_HOME, or specify the
# path to the "java" binary using JAVACMD
# (set JAVACMD to "auto" for automatic detection)
JAVA_HOME="/usr/local/java/jdk1.8.0_181"
JAVACMD="auto"

2.3.5 通过systemctl治理activemq启停

#启动activemq服务: 
systemctl start activemq
#查看服务状态: 
systemctl status activemq
#创立软件链接:
ln -s /usr/lib/systemd/system/activemq.service /etc/systemd/system/multi-user.target.wants/activemq.service
#开机自启: 
systemctl enable activemq
#检测是否开启胜利(enable): 
systemctl list-unit-files |grep activemq

2.3.6 防火墙配置,Web治理端口默认为8161,通信端口默认为61616

  1. 增加并重启防火墙

    firewall-cmd --zone=public --add-port=8161/tcp --permanent
    firewall-cmd --zone=public --add-port=61616/tcp --permanent
    systemctl restart firewalld.service
    
  1. 或者间接敞开防火墙

    systemctl stop firewalld.service

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理