# Unable to access elastic search over network

**URL:** <https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265>\
**Category:** Elasticsearch\
**Created:** [July 15, 2020, 10:28am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265 "2020-07-15T10:28:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bigranawab](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Bigranawab](https://discuss.elastic.co/u/Bigranawab)\
**Post date:** [July 15, 2020, 10:28am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/1 "2020-07-15T10:28:14Z")

</div>

Hi, I am trying to update elasticsearch.yml file to access elasticsearch over network. but when ever i can configurations and restart services it gives an error.  
Here are my configuration  
in YML file  
network.host = localhost changed to network.host= x.x.x.x  
after this configuration restarting elasticsearch.service failed and I am only able to access elasticsearch over local host.  
P.S: I have installed elasticsearch, kibana and logstash on single machine.

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [July 15, 2020, 10:34am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/2 "2020-07-15T10:34:59Z")

</div>

Try to use discovery.type: single-node if your cluster is 1 node  
Check it [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html) , ES use some bootsrap checks when you try to bind to an IP adresse, it force production checks ...

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 16, 2020, 4:32am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/3 "2020-07-16T04:32:53Z")

</div>

Welcome to our community! 😃

It'd help if you shared the error you are seeing from the logs. Please format your code/logs/config using the `</>` button, or markdown style back ticks. It helps to make things easy to read which helps us help you 🙂

---

<div class="post-metadata">

**Author:** ![Bigranawab](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Bigranawab](https://discuss.elastic.co/u/Bigranawab)\
**Post date:** [July 16, 2020, 8:26am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/4 "2020-07-16T08:26:54Z")

</div>

> [@Bigranawab](#):
>
> Hi, I am trying to update elasticsearch.yml file to access elasticsearch over network. but when ever i can configurations and restart services it gives an error.  
> Here are my configuration  
> in YML file  
> network.host = localhost changed to network.host= x.x.x.x  
> after this configuration restarting elasticsearch.service failed and I am only able to access elasticsearch over local host.  
> P.S: I have installed elasticsearch, kibana and logstash on single machine.

```auto
elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2020-07-15 19:26:22 PKT; 46min ago
     Docs: https://www.elastic.co
  Process: 986 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/F
 Main PID: 986 (code=exited, status=1/FAILURE)

جولائی 15 19:26:22 elk-elk systemd-entrypoint[986]: at org.yaml.snakeyaml.scanner.ScannerImpl.needMoreTokens(ScannerImpl.java:2
جولائی 15 19:26:22 elk-elk systemd-entrypoint[986]: at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226)
جولائی 15 19:26:22 elk-elk systemd-entrypoint[986]: at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(Parser
جولائی 15 19:26:22 elk-elk systemd-entrypoint[986]: at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
جولائی 15 19:26:22 elk-elk systemd-entrypoint[986]: at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
جولائی 15 19:26:22 elk-elk systemd-entrypoint[986]: at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.ja
جولائی 15 19:26:22 elk-elk systemd-entrypoint[986]: ... 14 more
جولائی 15 19:26:22 elk-elk systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
جولائی 15 19:26:22 elk-elk systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
جولائی 15 19:26:22 elk-elk systemd[1]: Failed to start Elasticsearch.
lines 1-17/17 (END)

```

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [July 16, 2020, 8:32am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/5 "2020-07-16T08:32:56Z")

</div>

did you add `discovery.type: single-node` to your `elasticsearch.yml` ?

---

<div class="post-metadata">

**Author:** ![Bigranawab](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Bigranawab](https://discuss.elastic.co/u/Bigranawab)\
**Post date:** [July 16, 2020, 8:45am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/6 "2020-07-16T08:45:15Z")

</div>

yes i tried this but still same error

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [July 16, 2020, 8:51am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/7 "2020-07-16T08:51:50Z")

</div>

can you share your elasticsearch.yml

---

<div class="post-metadata">

**Author:** ![Bigranawab](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Bigranawab](https://discuss.elastic.co/u/Bigranawab)\
**Post date:** [July 16, 2020, 1:46pm UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/8 "2020-07-16T13:46:36Z")

</div>

```auto

# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: Name
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: localhost
#
# Set a custom port for HTTP:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

```

---

<div class="post-metadata">

**Author:** ![Bigranawab](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Bigranawab](https://discuss.elastic.co/u/Bigranawab)\
**Post date:** [July 20, 2020, 8:57am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/9 "2020-07-20T08:57:29Z")

</div>

Resolved this issue.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 20, 2020, 9:30am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/10 "2020-07-20T09:30:26Z")

</div>

Please share the solution in the thread, it might help someone in future 🙂

---

<div class="post-metadata">

**Author:** ![Bigranawab](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Bigranawab](https://discuss.elastic.co/u/Bigranawab)\
**Post date:** [July 20, 2020, 9:57am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/11 "2020-07-20T09:57:41Z")

</div>

So, here is what i did,  
there is a line which is commented

# discovery.seed\_hosts: ["host1","host2"]

here I entered IP of my host and 0.0.0.0  
and in network.host I entered 0.0.0.0  
after this configuration when i restarted service it started and elasticsearch is accessible over network

---

<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:** [August 17, 2020, 9:57am UTC](https://discuss.elastic.co/t/unable-to-access-elastic-search-over-network/241265/12 "2020-08-17T09:57:43Z")

</div>

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