# Path to directory where to store the data

**URL:** <https://discuss.elastic.co/t/path-to-directory-where-to-store-the-data/133874>\
**Category:** Elasticsearch\
**Created:** [May 30, 2018, 12:35pm UTC](https://discuss.elastic.co/t/path-to-directory-where-to-store-the-data/133874 "2018-05-30T12:35:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![babar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/babar/32/31767_2.png) [@babar](https://discuss.elastic.co/u/babar)\
**Post date:** [May 30, 2018, 12:35pm UTC](https://discuss.elastic.co/t/path-to-directory-where-to-store-the-data/133874/1 "2018-05-30T12:35:16Z")

</div>

Whenever I change the default path of data and logs to another location then I face the below problem:

[elastic@elsqw1 elastic]$ systemctl status elasticsearch.service  
â elasticsearch.service - Elasticsearch  
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)  
Active: failed (Result: exit-code) since Wed 2018-05-30 12:42:49 AST; 6min ago  
Docs: [http://www.elastic.co](http://www.elastic.co)  
**Process: 42859 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID\_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)**  
**Main PID: 42859 (code=exited, status=1/FAILURE)**

I want to use the different volume/location for the data and logs. Please let me know how to do it?

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![Fram\_Souza](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fram_souza/32/24833_2.png) [@Fram\_Souza](https://discuss.elastic.co/u/Fram_Souza)\
**Post date:** [May 30, 2018, 9:26pm UTC](https://discuss.elastic.co/t/path-to-directory-where-to-store-the-data/133874/2 "2018-05-30T21:26:41Z")

</div>

Hi @babar

You need only change a path.data in elasticsearch.yml for a new directory.  
Remember, elasticsearch need have permission to access this directory.

---

<div class="post-metadata">

**Author:** ![babar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/babar/32/31767_2.png) [@babar](https://discuss.elastic.co/u/babar)\
**Post date:** [May 31, 2018, 7:16am UTC](https://discuss.elastic.co/t/path-to-directory-where-to-store-the-data/133874/3 "2018-05-31T07:16:33Z")

</div>

Hello @Fram_Souza

Thank you for your reply. I have a local user/group 'elastic/elastic' and the full permission assigned to the following directories:

- path.data: /u001/elastic/data/elasticsearch
- path.logs: /u001/elastic/log/elasticsearch

I wanted to use the above location as path instead of the default directories.

- path.data: /var/lib/elasticsearch
- path.logs: /var/log/elasticsearch

Whenever I change the path in the elasticsearch.yml file the the elasticsearch crashes with the message \*\***Main PID: 42859 (code=exited, status=1/FAILURE**)\*\*.

How can I use the custom path without crashing?

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![babar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/babar/32/31767_2.png) [@babar](https://discuss.elastic.co/u/babar)\
**Post date:** [May 31, 2018, 9:44am UTC](https://discuss.elastic.co/t/path-to-directory-where-to-store-the-data/133874/4 "2018-05-31T09:44:34Z")

</div>

Hello @Fram_Souza

I found that a user/group elasticsearch SSDPA created automatically with the installation of Elasticsearch.

Please correct me if I am wrong and share the correct steps with me e.g. should we assign the full permission to user/group elasticsearch SSDPA on the below directories:

- path.data: /u001/elastic/data/elasticsearch
- path.logs: /u001/elastic/log/elasticsearch

Because currently the local user/group 'elastic/elastic' has full permission assigned to the above directories.

Regards,

Babar

---

<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:** [June 28, 2018, 9:44am UTC](https://discuss.elastic.co/t/path-to-directory-where-to-store-the-data/133874/5 "2018-06-28T09:44:37Z")

</div>

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