博客园  :: 首页  :: 管理

Linux下apache activemq的安装与配置

Posted on 2015-10-22 16:13  520_1351  阅读(4984)  评论(1编辑  收藏  举报

ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线。ActiveMQ 是一个完全支持JMS1.1和J2EE 1.4规范

的 JMS Provider实现,尽管JMS规范出台已经是很久的事情了,但是JMS在当今的J2EE应用中间仍然扮演着特殊的地位。

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

操作系统:CentOS Linux release 7.1.1503 (Core)

服务器地址:192.168.100.2

jdk版本:java version "1.7.0_67"

ActiveMQ版本:apache-activemq-5.12.1

 

1、到ActiveMQ官网:http://activemq.apache.org,下载apache-activemq-5.12.1-bin.tar.gz

2、安装jdk-7u67-linux-x64.rpm,并配置环境变量

3、上传apache-activemq-5.12.1-bin.tar.gz到linux服务器,并解压、目录结构如下:

    其中部分目录的说明如下:

    bin目录:(windows下面的bat和unix/linux下面的sh) 启动ActiveMQ的启动服务就在这里

    conf目录: activeMQ配置目录,包含最基本的activeMQ配置文件

    data目录:activeMQ的日志文件目录

    webapps目录:系统管理员web控制界面文件

4、启动ActiveMQ,进入apache-activemq-5.12.1/bin目录,执行如下命令即可

[dhlr@5201351 bin]$ ./activemq start &            //其实新版的ActiveMQ也可以不加&后台符号,关闭ActiveMQ,使用./activemq stop

    在旧版的ActiveMQ(如笔者工作中,使用的是apache-activemq-5.8)还存在activemq-admin文件

    我们也可以使用./activemq-admin start命令启动,与./activemq start启动的效果是一样的

5、启动成功就可以以 http://ip地址:8161 方式访问管理界面,默认用户名和密码admin/admin

6、ActiveMQ启动后,默认会启用8161和61616两个端口

    其中8161端口为ActiveMQ的web管理控制端口, 61616为ActiveMQ的通讯端口

=================================================================

关于ActiveMQ的部分配置文件说明>>>>>>>>>>>>>>>>>>>

(1)web管理端口的修改,activemq使用了jetty服务器来进行管理,

        我们可以在conf/jetty.xml文件中对其配置,web管理端口默认为8161,定义在jetty.xml文件的如下位置

<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
             <!-- the default port number for the web console -->
        <property name="host" value="0.0.0.0"/>
        <property name="port" value="8161"/>
    </bean>

(2)通信端口的定义在ActiveMQ的主配置文件,./conf/activemq.xml

       <transportConnectors>
            <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        </transportConnectors>

(3)web管理界面默认的用户名为admin/admin,其配置文件位于./conf/jetty-realm.properties,其格式如下:

这里需要注意的是 用户名和密码的格式是:用户名 : 密码 ,角色名

 

 

 

尊重别人的劳动成果 转载请务必注明出处:http://www.cnblogs.com/5201351/p/4901380.html