When you tried to configure SonarQube, you may experience the below error:
Fix for the above issue:
create a user called sonar by executing below command:
sudo useradd sonar
sudo chown -R sonar:sonar sonar-install-folder/
Edit the sonar.sh start script and change the #RUN_AS_USER to be RUN_AS_USER=sonar
sudo vi /opt/sonarqube/bin/linux-x86-64/sonar.sh
Change
RUN_AS_USER=sonar
2018.10.15 17:32:13 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)
SonarQube does not support being run as root user
, so we need to create regular user like sonar and give privilege to that use.
Fix for the above issue:
create a user called sonar by executing below command:
sudo useradd sonar
sudo chown -R sonar:sonar sonar-install-folder/
Edit the sonar.sh start script and change the #RUN_AS_USER to be RUN_AS_USER=sonar
sudo vi /opt/sonarqube/bin/linux-x86-64/sonar.sh
Change
RUN_AS_USER=sonar
now start the server
sudo sh /opt/sonarqube/bin/linux-x86- 64/sonar.sh start
This should fix that issue.
No comments:
Post a Comment