Elastic search doesn't start. No errors. No logs. Only one warning "cannot be run as root"

Elasticsearch version: 5.1.1

Plugins installed: []

JVM version: java version "1.8.0_101"

OS version: CentOS release 6.8 (Final)

Description of the problem including expected versus actual behavior:
Elastic search is not starting. It gives me warning "org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root". But when I run without root, it gives me long list of errors; some of them are "java.io.FileNotFoundException: permission denied."
Steps to reproduce:

sudo ./elasticsearch
I have lowered the memory limits from config/jvm.options to 100-200mb. But doesn't work.

Provide logs (if relevant):

Describe the feature:

Any help is appreciated. Thanks in advance!

How did you install things?

I downloaded tar.gz from official site and unpacked.
I ran bin/elasticsearch to start the process

Did you look at https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html?

Also it sounds like you might need to chown the directory you extracted ES to.

Thank you for your prompt reply. I changed my config according to the "important settings" page; however ran into endless YAML parsing errors. Then commented out everything again as it was shipped with the .tar.gz. and it has started working.! No idea why. I will update here if I find the reason.

Thanks again!

Did your user have writes to read/write in the datas directory ? Read in the config directory, etc ?

On Centos you can add a yum reposity and do the installation running

yum install elasticsearch

it's pretty easy and packaged (if there is a version 5.x)

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