elasticsearch changing path.logs和/或path.data - 无法启动

时间:2016-01-25 06:42:06

标签: elasticsearch

这是我的配置

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

当我重新启动ElasticSearch时,这就是我得到的:

 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.

路径是附加卷,可通过 / 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

我尝试chown和chmod只是为了查看权限是否是问题,但它仍然无效。

我该如何解决这个问题?

感谢广告

备注:

3 个答案:

答案 0 :(得分:0)

尝试更改路径

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

绝对

答案 1 :(得分:0)

我进行了全新安装并遇到了同样的错误。

检查 path.data 目录中是否有一个包含群集名称的文件夹。如果是,请尝试删除它(如果可能,您不要丢失数据)。

删除此项并重新启动服务后,它就可以了(另一个名为 nodes 的文件夹已创建)

答案 2 :(得分:0)

  1. 将新模式和日志目录及文件的模式更改为777。
  2. 检查日志文件,如果它显示错误消息,如:
  3.   

    java.lang.IllegalStateException:检测到的索引数据   default.path.data [/ var / lib / elasticsearch]应该没有   任何;检查日志以获取详细信息

    如上所述,您必须删除旧的lib文件夹中的节点目录。 (先备份,索引数据将消失。)