How to troubleshoot CentOS root run Elasticsearch exception
Running Elasticsearch 2.3 on CentOS 6.5, the exception is as follows:
?
1 2 3 4 5 6 |
Exception in thread "main" Java.lang.RuntimeException:don ' t run Elasticsearch as root. At Org.elasticsearch.bootstrap.Bootstrap.initializeNatives (bootstrap.java:93) at Org.elasticsearch.bootstrap.Bootstrap.setup (bootstrap.java:144) at Org.elasticsearch.bootstrap.Bootstrap.init ( bootstrap.java:270) at Org.elasticsearch.bootstrap.Elasticsearch.main (ELASTICSEARCH.JAVA:35) refer to the log for Complete error details. |
The exception is described as not being able to run Elasticsearch with root permissions. The solution is to add parameters at run time:
?
1 |
Bin/elasticsearch-des.insecure.allow.root=true |
or modify the Bin/elasticsearch, plus the es_java_opts attribute:
?
1 |
Es_java_opts= "-des.insecure.allow.root=true" |
Restart Elasticsearch after saving.