Thursday, 21 April 2016

How to install SonarQube ?


Install SonarQube
Sonar server
  • It acts as a sonar server. 
  • Download the Sonar Qube 4.0 from http://www.sonarqube.org/downloads/  
  • Extract the zip and put at the VM at a location (For example: /home/sonarqube-4.0)
  
MySQL 
   1. Download and install MySql version 5.x 
   2. Create a database named “sonar” 
   3. Start the mysql service through command prompt.
   4. Download SQL Yog and connect to MySQL with username and password. 


Configuration of SonarQube
1. Set Sonar properties  
Open sonarqube-4.0\conf\ sonar.properties

Update JDBC properties  
sonar.jdbc.url=jdbc:mysql://10.239.199.97:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance 
sonar.jdbc.username=root 
sonar.jdbc.password=root 
sonar.jdbc.driverClassName=com.mysql.jdbc.Driver

Update Sonar server properties  
sonar.host.url=http://10.170.208.95:8090 
sonar.web.host=10.170.208.95 
sonar.web.port=8090 
sonar.web.context=/ 


2. Setup MySQL 
Create a database named “sonar” 
# su – mysql 
$ . myqenv 
$ mysql –uroot -proot  
create database sonar 

Ensure that MySQL instance is running and able to connect database “sonar” through SQLYog.
All the tables would be created automatically after the sonar ant task would run.

3. Start the sonar server  
Go to  sonarqube-4.0\bin and select your operating system (Eg: windows-x86-64 for window 7) and start Sonar server 
Example 
cd C:\E_Drive\sonarqube-4.0\bin\windows-x86-64 
Run the StartSonar.bat file.

Linux 
$ /home/sonarqube-4.0/bin/linux-x86-64/sonar.sh start | stop | status

Check sonar logs 
$ tail -f /home/sonarqube-4.0/logs/sonar.log

Check the sonar process  
$ ps -aef | grep java

No comments:

Post a Comment

Note: only a member of this blog may post a comment.