我正在尝试安装SonarQube:我已经遵循了以下步骤:
设置SOnarQube Tuto:此处
总结一下:
/opt/sonar
/opt/sonar/conf/sonar.properties
sonar.jdbc.username =声纳sonar.jdbc.password =声纳
sonar.jdbc.url = jdbc:mysql:// localhost:3306 / sonar?useUnicode = true&characterEncoding = utf8&rewriteBatchedStatements = true&useConfigs = maxPerformance
和
sonar.web.host=127.0.0.1 sonar.web.context=/sonar sonar.web.port=9000
须藤cp /opt/sonar/bin/linux-x86-64/sonar.sh /etc/init.d/sonar
sudo gedit /etc/init.d/sonar
插入两行:
SONAR_HOME=/opt/sonar PLATFORM=linux-x86-64 Modify the following lines: WRAPPER_CMD="${SONAR_HOME}/bin/${PLATFORM}/wrapper" WRAPPER_CONF="${SONAR_HOME}/conf/wrapper.conf"
…
PIDDIR="/var/run" Register as a Linux service: sudo update-rc.d -f sonar remove sudo chmod 755 /etc/init.d/sonar sudo update-rc.d sonar defaults
完成这些步骤之后:我尝试从中运行Sonar:localhost:9000/sonar执行后:sudo /etc/init.d/sonar start `奇怪的是,它没有运行。
localhost:9000/sonar
sudo /etc/init.d/sonar start
因此,当我运行`sudo /etc/init.d/sonar status时,我发现它会在几秒钟后继续运行,并且会在日志文件中引发一些错误,如下所示:
es.log:
2017.12.09 18:05:14 ERROR es[][o.e.b.Bootstrap] Exception java.lang.RuntimeException: can not run elasticsearch as root at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) ~[elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) [elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) [elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) [elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.6.3.jar:5.6.3] 2017.12.09 18:05:14 WARN es[][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.3.jar:5.6.3] Caused by: java.lang.RuntimeException: can not run elasticsearch as root at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) ~[elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.3.jar:5.6.3] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.3.jar:5.6.3] ... 6 more
有什么建议么 ??
更改对声纳文件的根访问权限。尝试以普通用户访问权限运行。
chown <another user>:<user group> sonar.sh