# Elasticsearch new data directory

**URL:** <https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298>\
**Category:** Elasticsearch\
**Created:** [February 3, 2018, 7:57am UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298 "2018-02-03T07:57:24Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anuar\_Mukatov](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anuar\_Mukatov](https://discuss.elastic.co/u/Anuar_Mukatov)\
**Post date:** [February 3, 2018, 7:57am UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/1 "2018-02-03T07:57:24Z")

</div>

Hello!  
Why after change directory elasticsearch data path, service failed to start.  
I change path in elasticsearch.yml to my directory. I make chown elasticsearch to directory and set chmod 777, but whithout changes...  
I changed the path.data: /opt/logs in elasticsearch.yml.  
After changes i can't start service and i have this error -

ExecStart=/usr/share/elasticsearch/bin/elasticsearch -Des.pidfile=${PID\_DIR}/elasticsearch.pid -Des.default.path.home=${ES\_HOME} -Des.default.path.logs=${LOG\_DIR} -Des.default.path.data=${DATA\_DIR} -Des.default.path.conf=${CONF\_DIR} (code=exited, status=1/FAILURE)

---

<div class="post-metadata">

**Author:** ![Anuar\_Mukatov](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anuar\_Mukatov](https://discuss.elastic.co/u/Anuar_Mukatov)\
**Post date:** [February 3, 2018, 8:37am UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/2 "2018-02-03T08:37:20Z")

</div>

I need help!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 3, 2018, 9:15am UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/3 "2018-02-03T09:15:52Z")

</div>

Read [this](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and specifically the "Also be patient" part.

You will a better chance to get fast answers if you provide details, like sharing your config file. (Format with `</>` icon please and check the preview window)

---

<div class="post-metadata">

**Author:** ![Anuar\_Mukatov](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anuar\_Mukatov](https://discuss.elastic.co/u/Anuar_Mukatov)\
**Post date:** [February 3, 2018, 11:05am UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/4 "2018-02-03T11:05:43Z")

</div>

I add my conf

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 3, 2018, 11:18am UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/5 "2018-02-03T11:18:30Z")

</div>

Where?

---

<div class="post-metadata">

**Author:** ![Anuar\_Mukatov](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anuar\_Mukatov](https://discuss.elastic.co/u/Anuar_Mukatov)\
**Post date:** [February 3, 2018, 11:34am UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/6 "2018-02-03T11:34:36Z")

</div>

I didn't change something else, i just uncomment path.data.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 3, 2018, 11:51am UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/7 "2018-02-03T11:51:04Z")

</div>

> i just uncomment path.data.

Which means that you changed something.  
So please share you `elasticsearch.yml` file if you need help.

---

<div class="post-metadata">

**Author:** ![Anuar\_Mukatov](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anuar\_Mukatov](https://discuss.elastic.co/u/Anuar_Mukatov)\
**Post date:** [February 3, 2018, 12:09pm UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/8 "2018-02-03T12:09:08Z")

</div>

My elasticsearch.yml file -

```
> #
> # ---------------------------------- Cluster -----------------------------------
> #
> #
> cluster.name: graylog
> #
> # ------------------------------------ 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: /opt/logs
> #
> # Path to log files:
> #
> #path.logs: /opt/logs
> #
> # ----------------------------------- 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: 192.168.0.1
> #
> # 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 new node is started:
> # The default list of hosts is ["127.0.0.1", "[::1]"]
> #
> #discovery.zen.ping.unicast.hosts: ["host1", "host2"]
> #
> # Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
> #
> #discovery.zen.minimum_master_nodes: 3
> #
> # For more information, consult the zen discovery 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

```

Status elasticsearch -

```
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: failed (Result: signal) since Sat 2018-02-03 17:15:09 +06; 1h 2min ago
     Docs: http://www.elastic.co
  Process: 12512 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${LOG_DIR} -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=${CONF_DIR} (code=killed, signal=KILL)
  Process: 12509 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 12512 (code=killed, signal=KILL)
Feb 03 17:13:48 graylog systemd[1]: Started Elasticsearch.
Feb 03 17:14:58 graylog elasticsearch[12512]: Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007fb1aa000000, 33554432, 0) failed; e...(errno=12)
Feb 03 17:15:01 graylog elasticsearch[12512]: #
Feb 03 17:15:01 graylog elasticsearch[12512]: # There is insufficient memory for the Java Runtime Environment to continue.
Feb 03 17:15:01 graylog elasticsearch[12512]: # Native memory allocation (mmap) failed to map 33554432 bytes for committing reserved memory.
Feb 03 17:15:01 graylog elasticsearch[12512]: # An error report file with more information is saved as:
Feb 03 17:15:01 graylog elasticsearch[12512]: # /tmp/hs_err_pid12512.log
Feb 03 17:15:09 graylog systemd[1]: elasticsearch.service: main process exited, code=killed, status=9/KILL
Feb 03 17:15:09 graylog systemd[1]: Unit elasticsearch.service entered failed state.
Feb 03 17:15:09 graylog systemd[1]: elasticsearch.service failed.
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 3, 2018, 1:27pm UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/9 "2018-02-03T13:27:46Z")

</div>

Please don't use citation then code format when formatting your code.

```auto
> # This is wrong

```

```auto
# This is correct

```

Anyway, why do you mix your data and logs?

```auto
path.data: /opt/logs

```

looks a wrong directory IMO.

But the problem is:

```auto
Feb 03 17:15:01 graylog elasticsearch[12512]: # There is insufficient memory for the Java Runtime Environment to continue.

```

---

<div class="post-metadata">

**Author:** ![Anuar\_Mukatov](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anuar\_Mukatov](https://discuss.elastic.co/u/Anuar_Mukatov)\
**Post date:** [February 3, 2018, 1:47pm UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/10 "2018-02-03T13:47:03Z")

</div>

I'm not mix them, just create directory with name logs)) Ok, can are you explain me please, right steps for change data path in elastic?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 3, 2018, 5:29pm UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/11 "2018-02-03T17:29:28Z")

</div>

> can are you explain me please, right steps for change data path in elastic?

What you did sounds correct to me.

Your problem is not here IMO as I said previously.

---

<div class="post-metadata">

**Author:** ![Anuar\_Mukatov](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Anuar\_Mukatov](https://discuss.elastic.co/u/Anuar_Mukatov)\
**Post date:** [February 3, 2018, 6:13pm UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/12 "2018-02-03T18:13:31Z")

</div>

What is IMO?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 3, 2018, 6:15pm UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/13 "2018-02-03T18:15:26Z")

</div>

In My Opinion

---

<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:** [March 3, 2018, 6:15pm UTC](https://discuss.elastic.co/t/elasticsearch-new-data-directory/118298/14 "2018-03-03T18:15:39Z")

</div>

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