我正在尝试创建一个Artemis服务器集群。我有两个artemis服务器,它们在this documentation中讨论的broker.xml中具有以下设置。
broker.xml的片段如下
<acceptors> <!-- Acceptor for every supported protocol --> <acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true</acceptor> <!-- AMQP Acceptor. Listens on default AMQP port for AMQP traffic.--> <acceptor name="amqp">tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpMinLargeMessageSize=102400;amqpDuplicateDetection=true</acceptor> <!-- STOMP Acceptor. --> <acceptor name="stomp">tcp://0.0.0.0:61613?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true</acceptor> <!-- HornetQ Compatibility Acceptor. Enables HornetQ Core and STOMP for legacy HornetQ clients. --> <acceptor name="hornetq">tcp://0.0.0.0:5445?anycastPrefix=jms.queue.;multicastPrefix=jms.topic.;protocols=HORNETQ,STOMP;useEpoll=true</acceptor> <!-- MQTT Acceptor --> <acceptor name="mqtt">tcp://0.0.0.0:1883?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true</acceptor> </acceptors>
我已将以下内容添加到broker.xml
<connectors> <connector name="nettyartemis">tcp://localhost:61619</connector> </connectors> <discovery-groups> <discovery-group name="my-discovery-group"> <local-bind-address>172.16.9.3</local-bind-address> <group-address>231.7.7.7</group-address> <group-port>9876</group-port> <refresh-timeout>10000</refresh-timeout> </discovery-group> </discovery-groups> <broadcast-groups> <broadcast-group name="my-broadcast-group"> <local-bind-address>172.16.9.3</local-bind-address> <local-bind-port>5432</local-bind-port> <group-address>231.7.7.7</group-address> <group-port>9876</group-port> <broadcast-period>2000</broadcast-period> <connector-ref>nettyartemis</connector-ref> </broadcast-group> </broadcast-groups>
在发现组的本地绑定地址中,我尝试使用172.16.19.3、172.16.19.7和172.16.19.8。现在,当我运行一台服务器时,它会显示以下警告信息(我认为),这意味着广播未开始,导致没有群集。
2020-06-11 17:10:59,277 WARN [org.apache.activemq.artemis.core.server] AMQ222116: unable to start broadcast group my-broadcast-group: java.net.BindException: Cannot assign requested address: Cannot bind at java.base/java.net.DualStackPlainDatagramSocketImpl.socketBind(Native Method) [java.base:] at java.base/java.net.DualStackPlainDatagramSocketImpl.bind0(DualStackPlainDatagramSocketImpl.java:84) [java.base:] at java.base/java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:131) [java.base: at java.base/java.net.DatagramSocket.bind(DatagramSocket.java:394) [java.base:] at java.base/java.net.DatagramSocket.<init>(DatagramSocket.java:244) [java.base:] at java.base/java.net.DatagramSocket.<init>(DatagramSocket.java:301) [java.base:] at org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory$UDPBroadcastEndpoint.openBroadcaster(UDPBroadcastEndpointFactory.java:176) [artemis-core-client-2.13.0.jar:2.13.0] at org.apache.activemq.artemis.core.server.cluster.impl.BroadcastGroupImpl.start(BroadcastGroupImpl.java:105) [artemis-server-2.13.0.jar:2.13.0] at org.apache.activemq.artemis.core.server.cluster.ClusterManager.start(ClusterManager.java:262) [artemis-server-2.13.0.jar:2.13.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart2(ActiveMQServerImpl.java:2983) [artemis-server-2.13.0.jar:2.13.0] at org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:76) [artemis-server-2.13.0.jar:2.13.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:599) [artemis-server-2.13.0.jar:2.13.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:526) [artemis-server-2.13.0.jar:2.13.0] at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:70) [artemis-cli-2.13.0.jar:2.13.0] at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:84) [artemis-cli-2.13.0.jar:2.13.0] at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:153) [artemis-cli-2.13.0.jar:2.13.0] at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:101) [artemis-cli-2.13.0.jar:2.13.0] at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:128) [artemis-cli-2.13.0.jar:2.13.0] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java.base:] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [java.base:] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java.base:] at java.base/java.lang.reflect.Method.invoke(Method.java:567) [java.base:] at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:134) [artemis-boot.jar:2.13.0] at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:50) [artemis-boot.jar:2.13.0] 2020-06-11 17:10:59,502 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:61616 for protocols [CORE,MQTT,AMQP,STOMP,HORNETQ,OPENWIRE] 2020-06-11 17:10:59,514 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:5445 for protocols [HORNETQ,STOMP]
任何建议为什么会这样?我在互联网上找不到任何在线资源对此进行解释。
我正在尝试创建一个Artemis服务器集群。我有两个artemis服务器,如本文档中所述,它们在broker.xml中具有以下设置。 broker.xml的片段如下所示:<...>
它可能会对其他人有所帮助,发布此问题后我发现了我的错误