ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线。ActiveMQ 是一个彻底支持JMS1.1和J2EE 1.4规范html
的 JMS Provider实现,尽管JMS规范出台已是好久的事情了,可是JMS在当今的J2EE应用中间仍然扮演着特殊的地位。java
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>linux
操做系统:CentOS Linux release 7.1.1503 (Core)web
服务器地址:192.168.100.2apache
jdk版本:java version "1.7.0_67"windows
ActiveMQ版本:apache-activemq-5.12.1服务器
一、到ActiveMQ官网:http://activemq.apache.org,下载apache-activemq-5.12.1-bin.tar.gz
app
二、安装jdk-7u67-linux-x64.rpm,并配置环境变量webapp
三、上传apache-activemq-5.12.1-bin.tar.gz到linux服务器,并解压、目录结构以下:tcp
其中部分目录的说明以下:
bin目录:(windows下面的bat和unix/linux下面的sh) 启动ActiveMQ的启动服务就在这里
conf目录: activeMQ配置目录,包含最基本的activeMQ配置文件
data目录:activeMQ的日志文件目录
webapps目录:系统管理员web控制界面文件
四、启动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启动的效果是同样的
五、启动成功就能够以 http://ip地址:8161 方式访问管理界面,默认用户名和密码admin/admin
六、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&wireFormat.maxFrameSize=104857600"/> <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> </transportConnectors>
(3)web管理界面默认的用户名为admin/admin,其配置文件位于./conf/jetty-realm.properties,其格式以下:
这里须要注意的是 用户名和密码的格式是:用户名 : 密码 ,角色名
尊重别人的劳动成果 转载请务必注明出处:http://www.cnblogs.com/5201351/p/4901380.html