在Windows 10上,Apache ActiveMQ Artemis 2.11.0无法启动,因为:
2020-03-28 23:03:04,322 INFO [org.apache.activemq.artemis.core.server] AMQ221080: Deploying address ExpiryQueue supporting [ANYCAST]
2020-03-28 23:03:04,322 INFO [org.apache.activemq.artemis.core.server] AMQ221003: Deploying ANYCAST queue ExpiryQueue on address ExpiryQueue
2020-03-28 23:03:06,418 ERROR [org.apache.activemq.artemis.core.server] AMQ224000: Failure in initialisation: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) [rt.jar:1.8.0_212]
at sun.nio.ch.Net.bind(Net.java:433) [rt.jar:1.8.0_212]
at sun.nio.ch.Net.bind(Net.java:425) [rt.jar:1.8.0_212]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) [rt.jar:1.8.0_212]
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:130) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:563) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1332) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:488) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:473) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:984) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:259) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:366) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:495) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905) [netty-all-4.1.34.Final.jar:4.1.34.Final]
at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118) [artemis-commons-2.11.0.jar:2.11.0]
2020-03-28 23:03:06,423 INFO [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.11.0 [0.0.0.0, nodeID=61904c81-713a-11ea-ad5b-902b34592bce]
2020-03-28 23:03:06,978 INFO [org.apache.activemq.hawtio.branding.PluginContextListener] Initialized activemq-branding plugin
我看过这篇文章,就像其他人一样。问题是我得到的错误是没有明确提及正在使用的端口,而只是:
java.net.BindException: Address already in use: bind
我尝试了所有建议的解决方案,但徒劳无功。另外,没有conf
文件夹或activemq.xml
文件。
更新:通过先前的声明,我的意思是说我已经检查过,并且其他服务/应用程序未使用Artemis使用的端口。
我所能找到的只是代理broker.xml
文件etc
夹中的文件。没有使用标准端口。还尝试禁用ICS(Internet连接共享)-完全无效。
我在这里想念什么?
ActiveMQ 5.x使用conf/activemq.xml
,但ActiveMQ Artemis使用,etc/broker.xml
因此您所看到的是预期的。最终,如您所引用的答案所述,这里的问题是,已经在运行代理或正在使用ActiveMQ想要绑定的端口运行其他服务。
默认情况下,ActiveMQ Artemis绑定到少数端口。这些定义在中etc/broker.xml
。这是默认配置:
<acceptors>
<acceptor name="artemis">tcp://0.0.0.0:61616??anycastPrefix=jms.queue.;multicastPrefix=jms.topic.;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>
<acceptor name="amqp">tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>
<acceptor name="stomp">tcp://0.0.0.0:61613?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true</acceptor>
<acceptor name="hornetq">tcp://0.0.0.0:5445?protocols=HORNETQ,STOMP;useEpoll=true</acceptor>
<acceptor name="mqtt">tcp://0.0.0.0:1883?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true</acceptor>
</acceptors>
因此,默认情况下,代理绑定以绑定到以下端口:
启动代理时,这些端口中的任何一个都可能已在使用中。您可能不需要您的代理来监听所有这些端口,因此我建议您禁用除绝对需要的端口以外的所有端口。如果解决了,然后你的问题很好,但如果没有,你可以使用排除法来找到一个已经在使用的,或从一个命令对方的回答(例如netstat
,fuser
等)。一旦确定了有问题的端口,就可以将其更改broker.xml
为使用其他端口,或者停止已经在使用它的进程。
如果确实没有使用任何端口,那么这意味着JVM网络堆栈的核心部分存在错误,因为这是异常的来源。我的直觉是没有这种错误,因此我建议使用我前面提到的消除方法。尝试注释掉所有acceptor
元素并启动代理。由于代理不会尝试绑定到任何端口,因此也不例外。然后停止代理,并添加acceptor
回元素之一,然后重新启动代理。对每个服务器执行此操作,acceptor
直到问题再次出现,此时您可以将代理的配置更改为使用其他端口。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句