Elasticsearch: ElasticSearch 2.0 install

Created on 3 Nov 2015  Â·  13Comments  Â·  Source: elastic/elasticsearch

Anyone getting problems installing the new elastic search 2.0?

I'm getting the "Exception in thread "main" java.lang.Runtimeexception: don't run as root"

Most helpful comment

Why don't you let me decide what I can and can not do.

All 13 comments

Sounds like you are trying to run elasticsearch as root user which is forbidden, security wise?

How do I run elasticsearch as root?
I understand the security considerations.

You can't run elasticsearch as root.

Why don't you let me decide what I can and can not do.

Why do you want to run elasticsearch as root?

That's not the point.
If I wanted to run as root then I should be able to.

That's exactly the point. If you have a problem, we will be happy to understand it and solve it...
We try to protect our users from external attacks. We don't allow to run a query for example with size=1000000000 because you will blow up your memory and cluster.

I do have a problem with you telling me what I can and can not do.

The issue is, although we work hard to improve defaults and security, there are still some very serious traps (like dynamic scripting).

So its very important that we have at least some basic facilities of the operating system: different user, filesystem permissions, etc.

I would like to start elasticsearch with Linux as autostart and it's means that the elasticseach should be start as root. or? You also write on your site (https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-service.html) that we should do something like this for autostart:

sudo /sbin/chkconfig --add elasticsearch
sudo service elasticsearch start

in this case it will be start as root! What should I do in this case?

p.s. I use SLES

in this case it will be start as root!

@sasauz You need superuser privileges so that the process can be started and daemonized under the elasticsearch user, but the service is in fact started under the elasticsearch user which you can see from

    daemon --user $ES_USER...

or

    start-stop-daemon -d $ES_HOME --start -b --user "$ES_USER -c "$ES_USER"...

depending on your system (where, in both cases, the default is for ES_USER to be set to elasticsearch).

For the most part you should be able to use the deb or rpm distribution if
you want fancy service things. If you can't use those it might be simpler
to see what they do and clone it then to rebuild from first principles.
On Dec 19, 2015 9:36 PM, "Jason Tedor" [email protected] wrote:

in this case it will be start as root!

@sasauz https://github.com/sasauz You need superuser privileges so that
the process can be started and daemonized under the elasticsearch user,
but the service is in fact started under the elasticsearch user which you
can see from

daemon --user $ES_USER...

or

start-stop-daemon -d $ES_HOME --start -b --user "$ES_USER -c "$ES_USER"...

depending on your system (where in both cases, the default is for ES_USER
to be set to elasticsearch).

—
Reply to this email directly or view it on GitHub
https://github.com/elastic/elasticsearch/issues/14458#issuecomment-166058289
.

@jasontedor and @nik9000 Thank you!

Was this page helpful?
0 / 5 - 0 ratings