I am a little confused. I have read you need to install Elastic as root and others say you must not. Some say install as root but run as another user. The docs aren't entire clear on this.
I have to do this for versions 6.X and unfortunately 5.2 as well. Any help is appreciated. Thank you.
If you install Elasticsearch from reb or rpm, it will automatically set up a user to run under. It's normal that installing rpms or deb packages requires root permissions on the server. Our docker images are also already set with users. So if you're using one of those methods, then just follow the docs we have and you should be good to go.
If you're downloading the tarball/zip and using some config management, this is when you have some options that can lead to bad outcomes. Do set up a user for Elasticsearch and do chown the directories to be owned by Elasticsearch. Don't try to run it as root. It will actually refuse to start if it detects that as a security precaution.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.