Path to directory where to store the data

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
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

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.

1 Like

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

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

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