This problem was reported in the past and none responded to it.
I would appreciate any suggestions on how to overcome the "Failed to start event bus java.net.BindException: Cannot assign requested address" problem.
---------------------------------------------------------------------------------
I am deploying a Vert.x cluster of 2 VMs into AWS EC2.
Hazelcast's AWS Auto-Detection works - both VMs find each other given a proper default-cluster.xml:
Members [2] {
Member [172.31.1.164]:50701
Member [172.31.6.14]:50701 this
}
[172.31.6.14]:50701 [prod-whildey] [3.6.2] Address[172.31.6.14]:50701 is STARTED
The problem is that after finding the cluster-host node, the second node fails with the following error:
Failed to start event bus
java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:125)
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:485)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1089)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:425)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:903)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:198)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:348)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
at java.lang.Thread.run(Thread.java:745)
All the needed ports are opened via AWS Security Group:
TCP - 35678 - specified via -cluster-port Vert.x command line setting and supposedly used by clustered event bus
TCP - 50701 - 50801 - specified via default-cluster.xml and is used by Hazelcast.
Both VMs connect to each other on port 50701.