why elasticsearch won't run on Ubuntu 14.04?

前端 未结 9 871
隐瞒了意图╮
隐瞒了意图╮ 2020-12-23 01:54

I\'m trying to determine if the elasticsearch instance is running, but it doesn\'t appear to be:

ubuntu@ubuntu:~$ sudo service elasticsearch status
 * elasti         


        
相关标签:
9条回答
  • 2020-12-23 02:59

    For me, this problem was caused by the Elasticsearch Data and/or Logs directory being at 100% disk usage. Run df -h to see whether the directory your Elasticsearch process is using for data and logs has free space or not.

    0 讨论(0)
  • 2020-12-23 03:00

    The elasticsearch user cannot write the PID file because it has no permissions to create a file in /var/run/:

    FileNotFoundException[/var/run/elasticsearch.pid (Keine Berechtigung)]
    

    The fix: create the directory /var/run/elasticsearch/, change its ownership to elasticsearch:elasticsearch, and change the PID file location to this directory in the init script.

    mkdir -p /var/run/elasticsearch
    chown elasticsearch: /var/run/elasticsearch
    sed -e 's|^PID_FILE=.*$|PID_FILE=/var/run/$NAME/$NAME.pid|g' -i /etc/init.d/elasticsearch
    

    Once you get that far, here's the next error you might see:

    ElasticsearchIllegalStateException[Failed to obtain node lock, is the following location writable?: [/var/lib/elasticsearch/elasticsearch]]
    

    Again a resource does not have the correct permissions for the elasticsearch user.

    chown -R elasticsearch: /var/lib/elasticsearch
    

    Not done yet. Now you have to edit /etc/init.d/elasticsearch and remove this line:

    test "$START_DAEMON" == true || exit 0
    

    This line is utter garbage and is guaranteed to cause an exit.

    Now it should finally start.

    0 讨论(0)
  • 2020-12-23 03:00

    This command resolved my issue:

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

    Referenced from @imsaar github

    0 讨论(0)
提交回复
热议问题