ActiveMQ更改端口

时间:2015-01-17 18:26:25

标签: port activemq broker

当我尝试启动我的ActiveMQ代理时,我得到一个已经在使用的地址错误:

2015-01-17 18:41:32,828 | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:Laptop-44709-1421516492312-0:1], java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to: java.net.BindException: Die Adresse wird bereits verwendet)

我尝试使用netstat检查端口5672中运行的服务grep,但由于某种原因它没有显示pid。所以我尝试更改amqp的默认端口:

<!--
        The transport connectors expose ActiveMQ over a given protocol to
        clients and other brokers. For more information, see:

        http://activemq.apache.org/configuring-transports.html
    -->
    <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:61617?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>

但是,当我尝试sudo /etc/init.d/activemq start时,ActiveMQ会忽略我的配置并继续连接到已经在使用的端口。

任何想法为什么?

我按照本指南设置了ActiveMQ: http://servicebus.blogspot.de/2011/02/installing-apache-active-mq-on-ubuntu.html

1 个答案:

答案 0 :(得分:0)

当我在Ubuntu中使用init.d中的simlink时,我遇到了ActiveMQ配置(特别是JMX)的问题。在用以下脚本替换simlink后,ActiveMQ开始正常工作:

#! /bin/sh
ACTIVEMQ_HOME="/opt/activemq"

case "$1" in
start)
$ACTIVEMQ_HOME/bin/activemq start
;;
stop)
$ACTIVEMQ_HOME/bin/activemq stop
;;
restart)
$ACTIVEMQ_HOME/bin/activemq restart
;;
status)
$ACTIVEMQ_HOME/bin/activemq status
;;
*)
echo "Valid commands: start|stop|restat|status" >&2
;;
esac
exit 0
相关问题