How to run Elasticsearch 2.1.1 as root user in Linux machine

限于喜欢 提交于 2019-11-30 06:01:12

Based of the following code-snippet looks like you should be able to achieve this by enabling property es.insecure.allow.root

Example :

bin/elasticsearch -Des.insecure.allow.root=true
  1. Open script file:

    vi bin/elasticsearch

  2. Add property for allow root:

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

  3. Save and close.
  4. You can start by root now.

Good luck.

You can also create alias

alias elasticsearch='elasticsearch -Des.insecure.allow.root=true'

Add above line in bashrc file, After that elasticsearch command will work.

You should change the owner and group of the elasticsearch-X.X.X and run as that user. It works in elasticsearch-5.3.0

There are two workarounds to resolve this issue :

Solution 1: download zip file n unzip then start by following command

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

Solution 2:

vi bin/elasticsearch

Add property to allow root to run two instance:

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

Save and close. You can start by root now.

we need to create a new user in Linux server say user = es and grant sudo chown -R es elasticsearch-6.1.0/ then you can switch 'es' user account and run ./elasticsearch-6.1.0/bin/elasticsearch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!