Use Sonar to build a code quality management platform

[The standard deployment process is as follows:]

step1: Create a user
wget to execute the sonar program https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-6.7.3.zip

step2: Download the installation package (the same installation package is used regardless of the operating system, but the startup method is different)
https://www.sonarqube.org/downloads/
Instructions: Download the corresponding sonar version according to your own jdk version , the requirements for jdk for each version are described in the document.
For example, see: https://docs.sonarqube.org/display/SONARQUBE70/Requirements

step3:jdk installation, skip it here, it is relatively simple, download the installation package, and configure the environment variables.
Execute the command to confirm that jdk is installed with Chen Gong.
#java -version

step4: Start sonar (select the corresponding startup file to start according to your operating system)
$sonar_home/bin/linux-x86-64/sonar.sh start

[Exception description and solution]

2018.05.09 10:19:34 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]

[Solution]
Because elasticsearch 5 is not allowed to use root to start, you can create an account (such as admin)
to start under this account.
At the same time, authorize the decompressed file to the admin account.

If it fails to start normally, you can go to the startup log directory to view the corresponding log file
$sonar_home/logs/es.log --elasticsearch log
$sonar_home/ce.log --compute engine log
$sonar_home/sonar.log --sonar log
$sonar_home/web.log --web log

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326045011&siteId=291194637