1.复制一份配置文件
cd apache-activemq-5.12.1
cp -r conf conf-new
2.修改配置文件activemq.xml
cd conf-new
vim activemq.xml
a)brokerName不能和原来的重复,修改brokerName="activemq-new"
b)数据存放的文件名称不能重复,修改kahaDB directory="${activemq.data}/kahadb-new"
c)所有涉及的transportConnector的端口,都要和原来的不一样。注意不要超出端口的范围(0-65535)
<transportConnectors> <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --> <transportConnector name="openwire" uri="tcp://0.0.0.0:62626?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="amqp" uri="amqp://0.0.0.0:5772?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="stomp" uri="stomp://0.0.0.0:62623?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1993?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="ws" uri="ws://0.0.0.0:62624?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> </transportConnectors>
3.修改配置文件jetty.xml
vim jetty.xml
a)管理页面端口不能重复,把里面的默认端口号8161改成别的,如8262
<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="8262"/> </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