Configure ES on aws linux to allow connection from public ip

Hello,
I am trying to run elasticsearch instance version 2.4.5 and here is my config file
network.host: XX.XX.XX.XX
Trying for single node on aws server

I have provided my aws public ip here...
When I start elasticsearch using ./bin/elasticsearch, it gives me error as -

[2017-04-28 17:37:13,988][INFO ][node                     ] [Mechamage] version[2.4.5], pid[13030], build[c849dd1/2017-04-24T16:18:17Z]
[2017-04-28 17:37:13,989][INFO ][node                     ] [Mechamage] initializing ...
[2017-04-28 17:37:14,476][INFO ][plugins                  ] [Mechamage] modules [reindex, lang-expression, lang-groovy], plugins [], sites []
[2017-04-28 17:37:14,528][INFO ][env                      ] [Mechamage] using [1] data paths, mounts [[/ (/dev/xvda1)]], net usable_space [8.3gb], net total_space [31.3gb], spins? [no], types [ext4]
[2017-04-28 17:37:14,528][INFO ][env                      ] [Mechamage] heap size [990.7mb], compressed ordinary object pointers [true]
[2017-04-28 17:37:16,007][INFO ][node                     ] [Mechamage] initialized
[2017-04-28 17:37:16,007][INFO ][node                     ] [Mechamage] starting ...
Exception in thread "main" BindTransportException[Failed to bind to [9300-9400]]; nested: ChannelException[Failed to bind to: /XX.XX.XX.XX:9400]; nested: BindException[Cannot assign requested address];
Likely root cause: 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 org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
        at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391)
        at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315)
        at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
        at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
        at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Refer to the log for complete error details.
[2017-04-28 17:37:16,096][INFO ][node                     ] [Mechamage] stopping ...
[2017-04-28 17:37:16,098][INFO ][node                     ] [Mechamage] stopped
[2017-04-28 17:37:16,098][INFO ][node                     ] [Mechamage] closing ...
[2017-04-28 17:37:16,103][INFO ][node                     ] [Mechamage] closed

I have tried network.host as 0.0.0.0 but it publishes to private ip and not accessible outsude of aws.

Thanks in advance.

You can only bind to a network card which actually exists.
I mean that ifconfig will give you which IPs can be used on your system.

Did you configure AWS to expose your machine outside AWS network?

Note that's super dangerous though as anyone could then have access to your instance and I'd not doing that.

Hello Dadoonet,
Thanks for response.
I have few applications running on aws configured to have connection only from my own personal laptop.(with all ports open only for my personal laptop ip)
ifconfig on aws machine gives me private ip starting with 172....and not public ip .

Thanks

So I believe you can just bind to this address.

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