最近玩一下sonar, centos上启动报错: can not run elasticsearch as root,log如下:
sonar.log
2017.11.20 21:16:48 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2017.11.20 21:16:49 INFO app[][o.e.p.PluginsService] no modules loaded
2017.11.20 21:16:49 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2017.11.20 21:16:50 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
2017.11.20 21:16:50 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2017.11.20 21:16:50 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
es.log
java.lang.RuntimeException: can not run elasticsearch as root
原因:因为安全问题elasticsearch 不让用root用户直接运行
参考网上的解决办法:ES_JAVA_OPTS="-Des.insecure.allow.root=true", 依旧报错,
解决方法:
liunx创建新用户 adduser XXX 创建的用户加密码 passwd XXX 输入两次密码,用该用户运行sonar即可