run Elasticsearch with root user

Error Can’t Run Elasticsearch As Root In Linux

When you’re installing Elasticsearch by root user. It won’t allow you to install it. This will give you an Error Can’t Run Elasticsearch as root.

Elasticsearch is a process. So this is need a user to run and installed.

Official Documentation, You may follow here Elasticsearch

Check Out :  Install Elasticsearch Using Source Code

Follow these Steps to solve your issues

Solution 1 : Set JAVA_HOME path

export JAVA_HOME=/usr/java/jdk-12/bin/java

Solution 2 : You can’t run Elasticsearch by root user. So, you need to have a user and group and make this user to the owner of Elasticsearch directory

useradd elastic

groupadd elastic

chown -R elastic:elastic elasticsearch-6.5.0

Check Out : BootStrap Checks Failed In ElasticSearch

then try this from bin folder

./elasticsearch -d

Solution 3 : Run this command to allow root user to install Elasticsearch

bin/elasticsearch -Des.insecure.allow.root=true -d

Else

Check Out :  Configuration Settings of Elasticsearch Before Installing

add these line to allow root in vim bin/elasticsearch

ES_JAVA_OPTS=”-Des.insecure.allow.root=true”

You’re done

Sponsored

LEAVE A REPLY

Please enter your comment!
Please enter your name here

17 − one =