在Ubuntu中启动Elasticsearch Server失败 [英] Starting Elasticsearch Server fail in ubuntu

查看:310
本文介绍了在Ubuntu中启动Elasticsearch Server失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(我是Elasticsearch的新手)

(I am new to elasticsearch)

我想将Elastic Search作为服务启动(sudo服务elasticsearch启动),但它不会启动,并且不告诉任何原因为什么它也不会启动,只是说-

I want to start elastic search as a service (sudo service elasticsearch start), but it wont start, and not tell anything about why it wont start either, just says -

启动Elasticsearch Server [失败]

Starting Elasticsearch Server [fail]

我尝试了以下更改,但未成功!

I tried following changes without success!


  1. es.logger.level:INFO更改为es.logger.level:DEBUG和es.logger.level:TRACE 分别未在var / log / elasticsearch的日志文件中看到任何内容!

  1. Changed es.logger.level: INFO to es.logger.level: DEBUG and es.logger.level: TRACE respectively without seeing anything in the log files in var/log/elasticsearch!

分别在中添加了 ES_HEAP_SIZE = 1024和ES_HEAP_SIZE = 512 usr / share / elasticsearch / bin / elasticsearch 文本文件,仍然-
启动Elasticsearch Server [失败]

Added ES_HEAP_SIZE= 1024 and ES_HEAP_SIZE= 512 respectively in usr/share/elasticsearch/bin/elasticsearch text file, still -
Starting Elasticsearch Server [fail]

我没有尝试更改 etc / elasticsearch / elasticsearch.yml -是否需要更改此文件的设置以使Elasticsearch作为ubuntu中的服务工作?

I have not tried changing anything in the configuration file at etc/elasticsearch/elasticsearch.yml - is it required to change the settings of this file to make elasticsearch work as a service in ubuntu?

推荐答案

基本上,这取决于赋予Elasticsearch user的用户权限-是的,Elasticsearch在Ubuntu内以 user身份运行!您需要在最终将要修改的文件夹中为其授予所有权权限。

It basically comes down to user permissions given to elasticsearch "user" - yes elasticsearch runs as a "user" inside Ubuntu! You need to give it ownership permissions inside folders it will eventually modify.

您需要在终端机内执行以下操作:

You need to do the following inside a terminal:


  1. sudo chown -R elasticsearch:elasticsearch / var / lib / elasticsearch



    / var / lib / elasticsearch 是弹性搜索存储数据的地方。



  2. sudo chown -R elasticsearch:elasticsearch / var / run / elasticsearch



    / var / run / elasticsearch 是存储Elasticsearch作为服务运行的进程ID的位置。



  3. sudo chown -R elasticsearch:elasticsearch / etc / elasticsearch
    < br>

    / etc / elasticsearch 是用于存储elasticsearch服务和elasticsearch日志的配置文件的地方。

  1. sudo chown -R elasticsearch:elasticsearch /var/lib/elasticsearch

    /var/lib/elasticsearch is where elasticsearch stores data.

  2. sudo chown -R elasticsearch:elasticsearch /var/run/elasticsearch

    /var/run/elasticsearch is where the process id of elasticsearch running as a service is stored.

  3. sudo chown -R elasticsearch:elasticsearch /etc/elasticsearch

    /etc/elasticsearch is the place where configuration file for elasticsearch service and elasticsearch logs is stored.

更改以上任何一个文件夹的所有权都会使您回到第一个方框,您需要执行步骤1, 2和3!

Changing ownership of any of the above folders will bring you back to square one, you will need to follow steps 1, 2 and 3 again!

您可能还需要设置 JAVA_HOME变量以使Elasticsearch作为服务运行

(仅以root用户身份更改elasticsearch.yml,从终端内部对其进行访问)

(change elasticsearch.yml only as a root user, accessing it from within the terminal)

这篇关于在Ubuntu中启动Elasticsearch Server失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆