Tag Archives: sonar6.7.2

[Solved] Sonar6.7.2 startup error: java.lang.RuntimeException: can not run elasticsearch as root sonar.log

Sonar6.7.2 startup error; The error message is as follows:

es.log

java.lang.RuntimeException: can not run elasticsearch as root
sonar.log

2018.03.05 21:16:48 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.03.05 21:16:49 INFO app[][o.e.p.PluginsService] no modules loaded
2018.03.05 21:16:49 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.03.05 21:16:50 WARN app[][o.s.a.p.AbstractProcessMon Tor] process exited with exit value [es]: 1
2018.03.05 21:16:50 info app [] [o.s.a.schedulerimpl] process [es] is stopped
2018.03.05 21:16:50 info app [] [o.s.a.schedulerimpl] sonarqube is stopped
error reason: elasticsearch cannot be run directly by root user due to security problems

Solution: liunx creates a new user, sonaruser, and runs sonar using this user

The steps are as follows:

Create user
$addUser sonaruser
create password for user
$passwd sonaruser
enter password twice,
modify the directory and user group of sonar as sonaruser
$chown – R sonaruser: sonaruser sonarqube-6.7.2
Restart sonar
$./sonar.sh start
create password for user
enter password twice,
Modify the directory and user group of sonar as sonaruser
Restart sonar