Run elasticsearch as root

Hi,

I have read on multiple occasions that you cannot run elasticsearch as root. I understand the principle behind this and I agree. However, due to very specific installation constraints, we do not install our solution (a series of java modules + elasticsearch) ourselves, we create an installer (a bash script) and the customer runs it as root.
This last part (running as root) is new information to us and now we are sort of stuck and don't know how to run elasticsearch.

Is it a good idea to fork the elasticsearch project, modify the part that throws the exception, package it and use this modified version instead of the official elasticsearch? It sounds like a bad idea to do so but we cannot find a proper workaround so far.

Thanks :slight_smile:

You are correct that this is a bad idea. You should work with your customer(s) to identify or create a non-root user as whom you can run Elasticsearch.

If your scripts run as root why not let the script create the elasticsearch user and then use that?

Thanks for the inputs. We will have a bash fluent engineer or two look into that issue before considering the very bad solution I mentioned.

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