# Not able to access my elasticsearch url via public IP

**URL:** <https://discuss.elastic.co/t/not-able-to-access-my-elasticsearch-url-via-public-ip/301110>\
**Category:** Elasticsearch\
**Created:** [March 30, 2022, 2:45pm UTC](https://discuss.elastic.co/t/not-able-to-access-my-elasticsearch-url-via-public-ip/301110 "2022-03-30T14:45:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepbisht](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@sandeepbisht](https://discuss.elastic.co/u/sandeepbisht)\
**Post date:** [March 30, 2022, 2:45pm UTC](https://discuss.elastic.co/t/not-able-to-access-my-elasticsearch-url-via-public-ip/301110/1 "2022-03-30T14:45:18Z")

</div>

Hi All,

I am not able to able to access url via public IP on port 9200.  
Even when i changed below setting in config file and tried to restart service, getting below error.

network.host: \<public\_ip\>  
http.port: 9200

root@ip-10-0-1-104:/home/ubuntu# systemctl restart Elasticsearch  
Job for Elasticsearch.service failed because the control process exited with error code.  
See "systemctl status Elasticsearch.service" and "journalctl -xe" for details.  
root@ip-10-0-1-104:/home/ubuntu#

---

<div class="post-metadata">

**Author:** ![sandeepbisht](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@sandeepbisht](https://discuss.elastic.co/u/sandeepbisht)\
**Post date:** [March 30, 2022, 2:58pm UTC](https://discuss.elastic.co/t/not-able-to-access-my-elasticsearch-url-via-public-ip/301110/2 "2022-03-30T14:58:31Z")

</div>

```auto
root@ip-10-0-1-104:/home/ubuntu# journalctl -xe
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketCh>
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:5>
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipe>
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHa>
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerC>
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:97>
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:260)
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExe>
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThread>
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventE>
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: at java.base/java.lang.Thread.run(Thread.java:833)
Mar 30 14:52:57 ip-10-0-1-104 systemd-entrypoint[10226]: For complete error details, refer to the log at /var/log/elasticsearch/elasticsearch.l>
Mar 30 14:52:58 ip-10-0-1-104 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An ExecStart= process belonging to unit elasticsearch.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
Mar 30 14:52:58 ip-10-0-1-104 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit elasticsearch.service has entered the 'failed' state with result 'exit-code'.
Mar 30 14:52:58 ip-10-0-1-104 systemd[1]: Failed to start Elasticsearch.
-- Subject: A start job for unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit elasticsearch.service has finished with a failure.
-- 
-- The job identifier is 3546 and the job result is failed.
root@ip-10-0-1-104:/home/ubuntu# tail -f /var/log/elasticsearch/elasticsearch.log 
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) ~[?:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[?:?]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]
	at java.lang.Thread.run(Thread.java:833) [?:?]
[2022-03-30T14:52:58,457][INFO][o.e.n.Node] [ip-10-0-1-104] stopping ...
[2022-03-30T14:52:58,465][INFO][o.e.n.Node] [ip-10-0-1-104] stopped
[2022-03-30T14:52:58,466][INFO][o.e.n.Node] [ip-10-0-1-104] closing ...
[2022-03-30T14:52:58,480][INFO][o.e.n.Node] [ip-10-0-1-104] closed
[2022-03-30T14:52:58,482][INFO][o.e.x.m.p.NativeController] [ip-10-0-1-104] Native controller process has stopped - no new native processes can be started

```

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [March 30, 2022, 3:03pm UTC](https://discuss.elastic.co/t/not-able-to-access-my-elasticsearch-url-via-public-ip/301110/3 "2022-03-30T15:03:20Z")

</div>

Hello,

Your post is in the wrong forum, please try to edit it and move to the Elasticsearch forum.

Also, Elasticsearch can only bind to IPs that exist in the host, if your public IP does not exist in the host, you will not be able to bind to it, this is probably your case.

---

<div class="post-metadata">

**Author:** ![sandeepbisht](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@sandeepbisht](https://discuss.elastic.co/u/sandeepbisht)\
**Post date:** [March 30, 2022, 3:05pm UTC](https://discuss.elastic.co/t/not-able-to-access-my-elasticsearch-url-via-public-ip/301110/4 "2022-03-30T15:05:18Z")

</div>

Hello,  
Thanks for your reply!  
You mean public should be attached to instance ?. If yes It is already associated with instance.  
I have checked security group also and found port 9200 is opened.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [March 30, 2022, 3:12pm UTC](https://discuss.elastic.co/t/not-able-to-access-my-elasticsearch-url-via-public-ip/301110/5 "2022-03-30T15:12:53Z")

</div>

The Elasticsearch process can only bind to IP address that are available directly to the host.

On cloud services when you associate a public IP to an instance it creates a NAT for that public IP to the private IP of your instance, the public IP is not available directly to the host.

You need to use `network.host` as `0.0.0.0`, this will bind the process to every IP available in the host.

After Elasticsearch is running, to connect using the public IP associated to your instance will depend on the network and security configuration of your cloud provider.

Also, **do not expose** your Elasticsearch instance to the internet without configuring security first.

---

<div class="post-metadata">

**Author:** ![sandeepbisht](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@sandeepbisht](https://discuss.elastic.co/u/sandeepbisht)\
**Post date:** [March 30, 2022, 3:17pm UTC](https://discuss.elastic.co/t/not-able-to-access-my-elasticsearch-url-via-public-ip/301110/6 "2022-03-30T15:17:58Z")

</div>

I tried `network.host` as `0.0.0.0` but getting same error while restarting the service.  
When i try network.host ` as `127.0.0.1` , I am able to restart service.

Is there anything you guess, I am missing at my end ?.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [March 30, 2022, 4:14pm UTC](https://discuss.elastic.co/t/not-able-to-access-my-elasticsearch-url-via-public-ip/301110/7 "2022-03-30T16:14:08Z")

</div>

What is the error when you try to start using `0.0.0.0`?

You need to share the more of the log error, do not use `tail -f` as this only get the last lines, try to start again and look at the Elasticsearch log file and share the error.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 27, 2022, 4:14pm UTC](https://discuss.elastic.co/t/not-able-to-access-my-elasticsearch-url-via-public-ip/301110/8 "2022-04-27T16:14:53Z")

</div>

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