How to run Elasticsearch 2.1.1 as root user in Linux machine

前端 未结 6 829
北恋
北恋 2020-12-29 23:55

I am trying to run Elasticsearch 2.1.1 in my Linux machine which I am the root user of it.

When I tried to execute the Elasticsearch.I am getting the following error

相关标签:
6条回答
  • 2020-12-30 00:36
    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.

    0 讨论(0)
  • 2020-12-30 00:40

    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

    0 讨论(0)
  • 2020-12-30 00:42

    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.

    0 讨论(0)
  • 2020-12-30 00:48

    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.

    0 讨论(0)
  • 2020-12-30 00:50

    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

    0 讨论(0)
  • 2020-12-30 00:58

    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
    
    0 讨论(0)
提交回复
热议问题