BindTransportException[Failed to bind to [9300-9400]]

Good day
I am using VM to run elastic search 2.3.3
i have changed only following to elasticsearch.yml file

network.host: xx.xx.xx.xxx

** http.port: 9200**

i have opened the port for inboud and out bound rules.

i have installed the service, when i am running i am getting following error:

BindTransportException[Failed to bind to [9300-9400]]; nested: ChannelException[Failed to bind to: /xx.xx.xx.xx:9400]; nested: BindException[Cannot assign requested address: bind];
at org.elasticsearch.transport.netty.NettyTransport.bindToPort(NettyTransport.java:478)
at org.elasticsearch.transport.netty.NettyTransport.bindServerBootstrap(NettyTransport.java:440)
at org.elasticsearch.transport.netty.NettyTransport.doStart(NettyTransport.java:321)
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:68)
at org.elasticsearch.transport.TransportService.doStart(TransportService.java:182)
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:68)
at org.elasticsearch.node.Node.start(Node.java:278)
at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:206)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:272)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /40.69.33.112:9400
at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
at org.elasticsearch.transport.netty.NettyTransport$1.onPortNumber(NettyTransport.java:460)
at org.elasticsearch.common.transport.PortsRange.iterate(PortsRange.java:69)
at org.elasticsearch.transport.netty.NettyTransport.bindToPort(NettyTransport.java:456)
... 9 more

any help in this regard appreciated.
one more thing: we are running Solr on the same VM

UPDATE : replacing network host value with : 0.0.0.0
worked for now.. can any one explain the threats or issues for opening it all IPs

1 Like

From the Javadocs:

Signals that an error occurred while attempting to bind a socket to a local address and port. Typically, the port is in use, or the requested local address could not be assigned.

Is it possible that you misconfigured network.host to an IP address that does not exist on any of your network interfaces? Maybe use one of the special values instead of going for an explicit value.

Hi, thanks for reply
No, i have double checked it.. ip is correct and more over Solr search is accessible with the same ip (We have both searches on the same VM.).

The IP address (which is still visible in the stacktrace of your original post) is a public IP and probably not one available on your network interfaces in the VM. To see which ones are available (after you've configured 0.0.0.0) have a look at the bound_addresses that appear in the ES log output.

Hi, below is the log which is showing 10.0.0.4:9300 as publish address..
after changing it to 0.0.0.0 (pls ignore time stamp)

thanks in advance

[2016-11-09 08:18:00,989][INFO ][node ] [Peter Parker] initializing ...
[2016-11-09 08:18:01,692][INFO ][plugins ] [Peter Parker] modules [reindex, lang-expression, lang-groovy], plugins [head, analysis-phonetic], sites [head]
[2016-11-09 08:18:01,723][INFO ][env ] [Peter Parker] using [1] data paths, mounts [[(C:)]], net usable_space [54.7gb], net total_space [126.9gb], spins? [unknown], types [NTFS]
[2016-11-09 08:18:01,723][INFO ][env ] [Peter Parker] heap size [989.8mb], compressed ordinary object pointers [unknown]
[2016-11-09 08:18:03,395][INFO ][node ] [Peter Parker] initialized
[2016-11-09 08:18:03,395][INFO ][node ] [Peter Parker] starting ...
[2016-11-09 08:18:03,551][INFO ][transport ] [Peter Parker] publish_address {10.0.0.4:9300}, bound_addresses {[::]:9300}
[2016-11-09 08:18:03,551][INFO ][discovery ] [Peter Parker] sapnet/K-jWzo3VS5C_TYaWWeY_tw
[2016-11-09 08:18:07,598][INFO ][cluster.service ] [Peter Parker] new_master {Peter Parker}{K-jWzo3VS5C_TYaWWeY_tw}{10.0.0.4}{10.0.0.4:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2016-11-09 08:18:07,707][INFO ][gateway ] [Peter Parker] recovered [0] indices into cluster_state
[2016-11-09 08:18:07,723][INFO ][http ] [Peter Parker] publish_address {10.0.0.4:9200}, bound_addresses {[::]:9200}
[2016-11-09 08:18:07,723][INFO ][node ] [Peter Parker] started

So that's your answer then (use 10.0.0.4). If that address is dynamically assigned (e.g. when VM is restarted) you can also use one of the special values which allow you for example to bind to an addresses of a specific network interface, for example en0.

Hi
If i use : 10.0.0.4, i can't access outside the vm, it works when i am browsing inside VM.
Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.