标签:java_opts detail 需要 替换 etc run elastics jdk cse
Exception in thread "main" java.lang.RuntimeException: don‘t run elasticsearch as root.
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:94)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:160)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:45)
Refer to the log for complete error details.
es5之后已经不允许用root启动了,这个参数已经不生效了,想用root启动es5、除非改源码重新编译
不能以root用户启动(在es5以下可以解决)
方法1:./elasticsearch -Des.insecure.allow.root=true
方法2:ES_JAVA_OPTS="-Des.insecure.allow.root=true"
启动 ./elasticsearch -d #-d是后台运行
elasticsearch开机自启动:
编辑文件:vi /etc/rc.d/rc.local,增加下面两行代码:
export JAVA_HOME=/usr/java/jdk1.7.0_80
/usr/local/workspaces/npu_elasticsearch/elasticsearch/elasticsearch-1.2.4/bin/elasticsearch -d
当然jdk,es路径和版本需要替换成您本机版本
标签:java_opts detail 需要 替换 etc run elastics jdk cse
原文地址:https://www.cnblogs.com/longyao/p/11719472.html