一台服务器运行多个ActiveMQ(版本apache-activemq-5.4.2)

一、在同一台机器上配置多个ActiveMQ(版本apache-activemq-5.4.2)
1.复制一份运行文件
  cp -r apache-activemq-5.4.2 apache-activemq-5.4.2-new
2.修改配置文件activemq.xml
  vi activemq.xml
  a)brokerName不能和原来的重复,修改brokerName="activemq-new" 
  b)数据存放的文件名称不能重复,修改kahaDB directory="${activemq.data}/kahadb-new"
  c)所有涉及的transportConnector的端口,都要和原来的不一样。注意不要超出端口的范围(0-65535)
     

[html] view plain copy

  1. <transportConnectors>  
  2.             <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->  
  3.             <transportConnector name="openwire" uri="tcp://0.0.0.0:62626?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>  
  4.             <transportConnector name="amqp" uri="amqp://0.0.0.0:5772?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>  
  5.             <transportConnector name="stomp" uri="stomp://0.0.0.0:62623?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>  
  6.             <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1993?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>  
  7.             <transportConnector name="ws" uri="ws://0.0.0.0:62624?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>  
  8.         </transportConnectors>  

 


  3.修改配置文件jetty.xml
    vim jetty.xml
    a)管理页面端口不能重复,把里面的默认端口号8161改成别的,如8262
       

 

[html] view plain copy

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

 


   4.到bin下面,复制一个activemq
    cp -r activemq activemq-new
    vim activemq-new
     a)修改程序的id,不能和原来的重复,ACTIVEMQ_PIDFILE="$ACTIVEMQ_DATA/activemq-new.pid"
b)修改配置文件路径ACTIVEMQ_CONF="$ACTIVEMQ_BASE/conf-new"
     cp -r env env-new
     vim env-new
     修改Activemq操作端口
     if [ -z "$ACTIVEMQ_QUEUEMANAGERURL" ]; then
    ACTIVEMQ_QUEUEMANAGERURL="--amqurl tcp://localhost:62626"
fi 
c)修改bin/activemq-new可执行文件 对env的引用改成env-new

 

 

 ACTIVEMQ_CONFIGS="/etc/default/activemq $HOME/.activemqrc $ACTIVEMQ_HOME/bin/env-new"

 

5.启动ActiveMQ

   cd apache-activemq-5.12.1/bin

   ./activemq-new start

6.查看ActiveMQ启动状态

   ./activemq-new status

7.通过管理页面访问

   http://ip:8262/admin

转自:http://47.98.145.144/notes/html/0d4ab1e56ace4d249e454a9a7ffa5b58.html

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值