Back to Uncategorized

Uncategorized

Upgrading to SonarQube

Author

Anjani Phuyal

Date

May 26, 2014

Category

Uncategorized

Read Time

5 min read

How to Upgrade

  • Check Compatibility of installed plugins
  • Read the upgrade instructions
  • Stop the Sonar
  • Down and extract the SonarQube from http://sonarsource.org/downloads
  • Update the contents of sonar.properties and wrapper.conf on /sonar-3.7.2/conf
  • Copy the plugins from old sonar
  • Backup the database
  • Start the webserver [NEW_SONARQUBE_HOME/bin/<SYSTEM>/sonar start]
  • Browse to http://localhost:9000/setup and follow the instruction
  • Start sonar as a service

http://docs.codehaus.org/display/SONAR/Running+SonarQube+as+a+Service+on+Linux

#!/bin/sh
#
# rc file for SonarQube
#
# chkconfig: 345 96 10
# description: SonarQube system (www.sonarsource.org)
#
### BEGIN INIT INFO
# Provides: sonar
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: SonarQube system (www.sonarsource.org)
# Description: SonarQube system (www.sonarsource.org)
### END INIT INFO
/usr/bin/sonar $*

Register SonarQube at boot time (Ubuntu, 32 bit):

sudo ln -s $SONAR_HOME/bin/linux-x86-32/sonar.sh /usr/bin/sonar
sudo chmod 755 /etc/init.d/sonar
sudo update-rc.d sonar defaults

Register SonarQube at boot time (RedHat, CentOS, 64 bit):

sudo ln -s $SONAR_HOME/bin/linux-x86-64/sonar.sh /usr/bin/sonar
sudo chmod 755 /etc/init.d/sonar
sudo chkconfig --add sonar

Tuning the Web Server

By default, SonarQube is configured to run on any computer with a simple Java JRE. The first thing to do when installing a production instance is to use a Java JDK and activate the server mode by uncommenting the following line in <install_directory>/conf/wrapper.conf:

wrapper.java.additional.3=-server

To change the Java JVM used by SonarQube, simply edit <install_directory>/conf/wrapper.conf and update the following line:

wrapper.java.command=/path/to/my/jdk/bin/java
#SonarQube#Linux#DevOps