具有相同绑定地址的-b 0.0.0.0抛出地址已在使用异常的群集模式下的Wildfly独立服务器

时间:2015-07-15 06:35:48

标签: jboss wildfly

我们正在使用链接http://middlewaremagic.com/jboss/?p=1952以群集模式创建两个独立服务器。我们按如下方式启动服务器

./standalone.sh -c standalone-ha.xml -b 0.0.0.0 -u 230.0.0.4 -Djboss.bind.address.management=10.91.154.68 -Djboss.management.http.port=55011 -Djboss.server.config.dir=$fwkInstancesDir/server1/configuration  -Djboss.node.name=server1 -Djboss.ajp.port=8010 -Djboss.server.base.dir=$fwkInstancesDir/server1 -Djboss.http.port=55000


./standalone.sh -c standalone-ha.xml -b 0.0.0.0 -u 230.0.0.4 -Djboss.bind.address.management=10.91.154.68 -Djboss.management.http.port=55031 -Djboss.server.config.dir=$fwkInstancesDir/server2/configuration  -Djboss.node.name=server2 -Djboss.ajp.port=8020 -Djboss.server.base.dir=$fwkInstancesDir/server2 -Djboss.http.port=55020

我们保持独立服务器的Bind地址相同。两个服务器都启动并运行,但第二个服务器日志显示如下错误。当我们尝试通过jboss-cli连接到服务器并获取JNDI视图时,未显示第二个服务器。有人对此问题有任何建议吗?

[31m02:49:32,371 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 54) MSC000001: Failed to start service jboss.infinispan.web.global-component-registry: org.jboss.msc.service.StartException in service jboss.infinispan.web.global-component-registry: org.infinispan.manager.EmbeddedCacheManagerStartupException: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type ChannelTransport
    at org.jboss.as.clustering.msc.AsynchronousService$1.run(AsynchronousService.java:91) [wildfly-clustering-common-8.2.0.Final.jar:8.2.0.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final.jar:2.1.1.Final]
Caused by: org.infinispan.manager.EmbeddedCacheManagerStartupException: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type ChannelTransport
    at org.infinispan.factories.GlobalComponentRegistry.start(GlobalComponentRegistry.java:241)
    at org.jboss.as.clustering.infinispan.subsystem.GlobalComponentRegistryService.start(GlobalComponentRegistryService.java:33)
    at org.jboss.as.clustering.msc.AsynchronousService$1.run(AsynchronousService.java:86) [wildfly-clustering-common-8.2.0.Final.jar:8.2.0.Final]
    ... 4 more
Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object of type ChannelTransport
    at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:185)
    at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:869)
    at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:638)
    at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:627)
    at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:530)
    at org.infinispan.factories.GlobalComponentRegistry.start(GlobalComponentRegistry.java:219)
    ... 6 more
Caused by: org.infinispan.commons.CacheException: Unable to start JGroups Channel
    at org.infinispan.remoting.transport.jgroups.JGroupsTransport.startJGroupsChannelIfNeeded(JGroupsTransport.java:198)
    at org.infinispan.remoting.transport.jgroups.JGroupsTransport.start(JGroupsTransport.java:187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_79]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_79]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_79]
    at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_79]
    at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:183)
    ... 11 more
Caused by: java.lang.Exception: connecting to channel "web" failed
    at org.jgroups.JChannel._connect(JChannel.java:544)
    at org.jgroups.JChannel.connect(JChannel.java:290)
    at org.jgroups.JChannel.connect(JChannel.java:275)
    at org.infinispan.remoting.transport.jgroups.JGroupsTransport.startJGroupsChannelIfNeeded(JGroupsTransport.java:196)
    ... 17 more
Caused by: java.lang.IllegalArgumentException: failed to start server socket
    at org.jgroups.protocols.FD_SOCK.down(FD_SOCK.java:321)
    at org.jgroups.protocols.FD_ALL.down(FD_ALL.java:218)
    at org.jgroups.protocols.VERIFY_SUSPECT.down(VERIFY_SUSPECT.java:84)
    at org.jgroups.protocols.pbcast.NAKACK2.down(NAKACK2.java:533)
    at org.jgroups.protocols.UNICAST3.down(UNICAST3.java:576)
    at org.jgroups.protocols.pbcast.STABLE.down(STABLE.java:347)
    at org.jgroups.protocols.pbcast.GMS.down(GMS.java:1045)
    at org.jgroups.protocols.FlowControl.down(FlowControl.java:340)
    at org.jgroups.protocols.FlowControl.down(FlowControl.java:340)
    at org.jgroups.protocols.FRAG2.down(FRAG2.java:136)
    at org.jgroups.protocols.RSVP.down(RSVP.java:142)
    at org.jgroups.stack.ProtocolStack.down(ProtocolStack.java:1024)
    at org.jgroups.JChannel.down(JChannel.java:760)
    at org.jgroups.JChannel._connect(JChannel.java:538)
    ... 20 more
Caused by: java.net.BindException: bind_addr /0.0.0.0 is not a valid interface: java.net.BindException: Address already in use
    at org.jgroups.util.Util.createServerSocket(Util.java:3567)
    at org.jgroups.protocols.FD_SOCK.startServerSocket(FD_SOCK.java:584)
    at org.jgroups.protocols.FD_SOCK.down(FD_SOCK.java:318)
    ... 33 more

1 个答案:

答案 0 :(得分:0)

JGroups无法绑定到0.0.0.0,而是将其绑定到127.0.0.1或其他IP。

另外,如上所述,使用-Djboss.socket.binding.port-offset通常是一个好主意,因为您可能会错过一个您甚至没想过的服务的端口。