.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

I wanted to enable SSL on the elastic search , after adding the certificates , i need to restart the elasticsearch where it is throwing error.
I have tried this by creating a user but it is showing error .i have attached that in below image



You can't run ES via sudo when configuring a non-loopback host.
Running ES from your elastic user fails because you seem to not be using an ES version with bundled JDK while the default java of your elastic user is a JDK8 version.

To make things work with your elastic user you must either point JAVA_HOME for that user at a valid JDK11 or better yet use an Elasticsearch distribution that comes with a bundled JDK.

@Armin_Braun ,
I have tried the way you suggested , Downloaded the JDK-11 and had set the JAVA_HOME. The Warning which i got previously had gone. Is there any thing should i try , i need to get that started . after applying the SSL certificates , the error is popped.

I somehow managed to get rid of the error ,but got stuck at this very point.
Could you help me with this?

@Sreekanth3 could it be that all the ES files are owned by root and the elastic user can't write to the ES (data-)folder? (looks looks like it)

1 Like

Hey @Armin_Braun I want to implement SSL certificates on my machine , I tried one way got failed . when i open my ES with http it's working , while i use https ES is not working.
Could you suggest me one best way to implement SSL .I have used this link

That was the correct , later i have changed the file permissions and it worked out.

@Sreekanth3 Could you open a new thread for this issue and clearly show/describe the steps you took and the error you're seeing in there?

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