码上敲享录 > Elasticsearch常见问题 > Caused by: java.lang.RuntimeException: can not run elasticsearch as root

Caused by: java.lang.RuntimeException: can not run elasticsearch as root

上一章章节目录下一章 2021-04-08已有1209人阅读 评论(0)

Caused by: java.lang.RuntimeException: can not run elasticsearch as root


解决方法:

创建elsearch用户组及elsearch用户

[root@xxx elasticsearch-5.5.1]# groupadd elsearch

[root@xxx elasticsearch-5.5.1]# useradd elsearch -g elsearch -p elasticsearch


给用户及组赋/usr/local/java/elasticsearch-5.5.1目录权限,目录改成你安装的目录

[root@xxx elasticsearch-5.5.1]# chown -R elsearch:elsearch /usr/local/java/elasticsearch-5.5.1


切换到elsearch用户再启动

[root@xxx elasticsearch-5.5.1]# su elsearch


再启动

[elsearch@xxx elasticsearch-5.5.1]$ ./bin/elasticsearch


0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交