elasticsearch changing path.logs and/or path.data - fails to start

百般思念 提交于 2021-02-08 06:47:48

问题


Here's my config

# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /mulelogs/elasticsearch
path.logs: /mulelogs/elasticsearch

When I restart ElasticSearch this is what I get:

 elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2016-01-25 06:33:40 UTC; 9s ago
     Docs: http://www.elastic.co
  Process: 22213 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)
  Process: 22212 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 22213 (code=exited, status=1/FAILURE)

elasticsearch[22213]: at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1074)
elasticsearch[22213]: at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1061)
elasticsearch[22213]: at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:88)
elasticsearch[22213]: at org.elasticsearch.bootstrap.Bootstrap.initialSettings(Bootstrap.java:217)
elasticsearch[22213]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:256)
elasticsearch[22213]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
elasticsearch[22213]: Refer to the log for complete error details.
systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
systemd[1]: Unit elasticsearch.service entered failed state.
systemd[1]: elasticsearch.service failed.

The path is an attached volume which is accessible via /mulelogs/

drwxrwxrwx.  4 root          root           4096 Jan 25 05:11 .
dr-xr-xr-x. 18 root          root           4096 Jan 25 06:24 ..
drwxrwxrwx.  4 elasticsearch elasticsearch  4096 Jan 25 05:21 elasticsearch
drwxrwxrwx.  2 root          root          16384 Jan 20 01:20 lost+found

I tried chown and chmod just to see if the permission is the problem, but it still didn't work.

How do I fix this?

Thanks in ad

Notes:

  • OS: CentOS 7
  • ElasticSearch : 2.1
  • I have installed ELK following this steps: https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-centos-7

回答1:


try changing the paths

path.data: /mulelogs/elasticsearch path.logs: /mulelogs/elasticsearch

to absolute




回答2:


I had a fresh install and had the same error.

Check if you have a folder in your path.data directory with the name of your cluster. If yes, try to delete it (if possible and you don't loose data).

After deleting this and restarting the service it went ok (another folder called nodes was created)




回答3:


  1. change mode to 777 for new lib and log directories and files.
  2. check the log file, if it shows error message like:

java.lang.IllegalStateException: detected index data in default.path.data [/var/lib/elasticsearch] where there should not be any; check the logs for details

as the above error, you have to delete the nodes directory in old lib folder. (Backup first, index data will be gone.)



来源:https://stackoverflow.com/questions/34986526/elasticsearch-changing-path-logs-and-or-path-data-fails-to-start

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!