# How to change directory for path.data and path.logs in elasticsearch in cent Operating system 7.7?

**URL:** <https://discuss.elastic.co/t/how-to-change-directory-for-path-data-and-path-logs-in-elasticsearch-in-cent-operating-system-7-7/190505>\
**Category:** Elasticsearch\
**Created:** [July 15, 2019, 10:39am UTC](https://discuss.elastic.co/t/how-to-change-directory-for-path-data-and-path-logs-in-elasticsearch-in-cent-operating-system-7-7/190505 "2019-07-15T10:39:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anam\_Alfiya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anam_alfiya/32/50147_2.png) [@Anam\_Alfiya](https://discuss.elastic.co/u/Anam_Alfiya)\
**Post date:** [July 15, 2019, 10:39am UTC](https://discuss.elastic.co/t/how-to-change-directory-for-path-data-and-path-logs-in-elasticsearch-in-cent-operating-system-7-7/190505/1 "2019-07-15T10:39:46Z")

</div>

How to change directory for path.data and path.logs in elasticsearch in cent Operating system 7.7?

I tried to change the path manually in yml file. But every time error is popping out and its failing due to configuration issue.

Error is stating : ERROR Unable to create file /home/user/new\_path/logs/file.log java.io.IOException: Could not create directory /home/user/new\_path/logs/

---

<div class="post-metadata">

**Author:** ![wu3rstle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wu3rstle/32/49963_2.png) [@wu3rstle](https://discuss.elastic.co/u/wu3rstle)\
**Post date:** [July 15, 2019, 10:45am UTC](https://discuss.elastic.co/t/how-to-change-directory-for-path-data-and-path-logs-in-elasticsearch-in-cent-operating-system-7-7/190505/2 "2019-07-15T10:45:29Z")

</div>

Does the directory `/home/user/new_path/` exist?

Maybe the permissions are not correct.

---

<div class="post-metadata">

**Author:** ![Anam\_Alfiya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anam_alfiya/32/50147_2.png) [@Anam\_Alfiya](https://discuss.elastic.co/u/Anam_Alfiya)\
**Post date:** [July 15, 2019, 12:05pm UTC](https://discuss.elastic.co/t/how-to-change-directory-for-path-data-and-path-logs-in-elasticsearch-in-cent-operating-system-7-7/190505/3 "2019-07-15T12:05:49Z")

</div>

I opened elasticsearch.yml file, then changed path.log to /home/user\_name/new\_path\_to\_logs and path.data to /home/user\_user/new\_path\_to\_data. And then when I tried sudo systemctl start Elasticsearch. Error which I got is stating : ERROR Unable to create file /home/user/new\_path/logs/file.log java.io.IOException: Could not create directory /home/user/new\_path/logs/

---

<div class="post-metadata">

**Author:** ![wu3rstle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wu3rstle/32/49963_2.png) [@wu3rstle](https://discuss.elastic.co/u/wu3rstle)\
**Post date:** [July 15, 2019, 12:51pm UTC](https://discuss.elastic.co/t/how-to-change-directory-for-path-data-and-path-logs-in-elasticsearch-in-cent-operating-system-7-7/190505/4 "2019-07-15T12:51:56Z")

</div>

Did you try to execute `sudo systemctl reload Elasticsearch` before restarting it?

---

<div class="post-metadata">

**Author:** ![Anam\_Alfiya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anam_alfiya/32/50147_2.png) [@Anam\_Alfiya](https://discuss.elastic.co/u/Anam_Alfiya)\
**Post date:** [July 16, 2019, 7:11am UTC](https://discuss.elastic.co/t/how-to-change-directory-for-path-data-and-path-logs-in-elasticsearch-in-cent-operating-system-7-7/190505/5 "2019-07-16T07:11:41Z")

</div>

I used : systemctl daemon-reload elasticsearch before and after every modification done on yml file.  
Still it didn't work.

---

<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 13, 2019, 7:11am UTC](https://discuss.elastic.co/t/how-to-change-directory-for-path-data-and-path-logs-in-elasticsearch-in-cent-operating-system-7-7/190505/6 "2019-08-13T07:11:46Z")

</div>

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