ActiveMQ 5.15.x Release安装和配置--Linux篇


声明:本文转载自https://my.oschina.net/u/3209432/blog/1579863,转载目的在于传递更多信息,仅供学习交流之用。如有侵权行为,请联系我,我会及时删除。

阅读目录:

1. 关闭防火墙和Selinux

2. 下载并安装ActiveMQ 5.15.x Release版本

3. 启动并验证

4.配置ActiveMQ 5.15.x Release自启动

5.注意事项以及说明

1. 关闭防火墙和Selinux

        Linux的防火墙是咱们新手的噩梦,很多情况会出现能ping通,但是访问不了Web页面。所以开始就干掉它!

    1.1 关闭防火墙

    [root@localhost ~]# /etc/init.d/iptables stop    
    iptables: Setting chains to policy ACCEPT: filter          [  OK  ]    
    iptables: Flushing firewall rules:                         [  OK  ]    
    iptables: Unloading modules:                               [  OK  ]

    1.2 开机自动关闭防火墙

    [root@localhost ~]# chkconfig iptables off

    1.3 查看Selinux状态

    [root@localhost ~]# sestatus    
    SELinux status: enabled 
    SELinuxfs mount: /sys/fs/selinux 
    SELinux root directory: /etc/selinux 
    Loaded policy name: targeted 
    Current mode: enforcing 
    Mode from config file: enforcing 
    Policy MLS status: enabled 
    Policy deny_unknown status: allowed 
    Max kernel policy version: 28

    1.4 关闭selinux

    [root@localhost ~]# vi /etc/selinux/config

修改 SELINUX=disabled 
注:永久开启->改成:SELINUX=enforcing

2. 下载并安装ActiveMQ 5.15.x Release版本

注:为了方便管理,创建一个文件夹专门放所需软件

    [root@localhost /]# mkdir developer    
    [root@localhost /]# cd developer

    2.1 下载ActiveMQ 5.15.x Release

    [root@localhost developer]# wget http://www.apache.org/dyn/closer.cgi?filename=/activemq/5.15.2/apache-activemq-5.15.2-bin.tar.gz&action=download

注:ActiveMQ 5.15.x Release 官网url如下:

http://activemq.apache.org/activemq-5152-release.html

     2.2 解压ActiveMQ 5.15.x Release

    [root@localhost developer]# tar -zxvf apache-activemq-5.15.2-bin.tar.gz

3. 启动并验证

    3.1 进入ActiveMQ文件夹

    [root@localhost developer]# cd apache-activemq-5.15.2

    3.2 启动ActiveMQ

    [root@localhost apache-activemq-5.15.2]# ./bin/activemq start

    3.3 验证ActiveMQ是否启动

    方式1:打开浏览器,输入ip:8161/admin/index.jsp,比如:192.168.163.129:8161/admin/index.jsp

        账号:admin,密码:admin
    方式2:检查端口号,或者进程,再者检查状态

    检查端口号

    [root@localhost apache-activemq-5.15.2]# netstat -an | grep 61616

    检查进程

    [root@localhost apache-activemq-5.15.2]# ps -ef | grep activemq

    检查状态

    [root@localhost apache-activemq-5.15.2]# ./bin/activemq status

4. 配置ActiveMQ 自启动

    4.1 复制ActiveMQ解压文件夹(为了自启动方便)

    [root@localhost apache-activemq-5.15.2]# cd ..
    [root@localhost developer]# cp -r /developer/apache-activemq-5.15.2/ /usr/local/active

    4.2 复制ActiveMQ启动文件

    [root@localhost developer]# cp /usr/local/activemq/bin/activemq /etc/init.d

    4.3 编辑ActiveMQ启动文件

    [root@localhost developer]# vim /etc/init.d/activemq

    在最后一行添加如下代码

export JAVA_HOME=/usr/java/jdk1.8.0_144
            ACTIVEMQ_HOME=/usr/local/activemq

  4.4 赋予ActiveMQ启动文件的权限

    [root@localhost developer]# cd /etc/init.d    
    [root@localhost developer]# chmod +x /etc/init.d/activemq

  4.5 添加到系统启动文件中

    [root@localhost developer]# chkconfig --add activemq

   4.6 检验查看列表

    [root@localhost developer]# chkconfig --list|grep activemq     
    activemq           0:off    1:off    2:off    3:on    4:off    5:on    6:off

5. 注意事项以及说明

    注意事项:

    ActiveMQ 5.15.x Release 有对应的JDK版本最低为1.8,检查jdk版本是否匹配,不则启动ActiveMQ就会报错

    检查jdk:

    [root@localhost apache-activemq-5.15.2]# java -version    
    java version "1.8.0_144"
    Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
    Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

    说明:本次使用

        操作系统:CentOS 6.8 64位

        ActiveMQ版本:5.15.2Release

        JDK版本:1.8.0_144


本文发表于2017年11月26日 10:33
(c)注:本文转载自https://my.oschina.net/u/3209432/blog/1579863,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如有侵权行为,请联系我们,我们会及时删除.

阅读 5218 讨论 5 喜欢 0

抢先体验

扫码体验
趣味小程序
文字表情生成器

闪念胶囊

你要过得好哇,这样我才能恨你啊,你要是过得不好,我都不知道该恨你还是拥抱你啊。

直抵黄龙府,与诸君痛饮尔。

那时陪伴我的人啊,你们如今在何方。

不出意外的话,我们再也不会见了,祝你前程似锦。

这世界真好,吃野东西也要留出这条命来看看

快捷链接
网站地图
提交友链
Copyright © 2016 - 2021 Cion.
All Rights Reserved.
京ICP备2021004668号-1