SonarQube Up and Running

SonarQube 3.6.3 + Maven 2.0.11 + PostgreSQL

PostgreSQL Setup

STEP 1: Make sure postgres binaries  are available in your PATH.

1

STEP 2: Initialize postgres db, execute the following command

initdb -D datapath

2

STEP 3: Start the database, execute the following command

pg_ctl start -l “E:\logs\postgres\sonar.log” -D “E:\data\postgres\sonar”

3

STEP 4: Verify that postgres is listening on the default port (5432)

netstat -aon | findstr 127.0.0.1:5432

4

STEP 5: Set up the sonar database

Create user postgres, and database sonar, by  executing the following command

createuser -s -r postgres

createdb sonar

5

connect to sonar databaseas, by  executing the following command

psql sonar

6

Create user sonar and grant all the permissions, as sonar will create tables/indexes/constraints for you, by  executing the following command

create user sonar with password ‘sonar';

grant all on database sonar to sonar;

7

Download SonarQube

Download SonarQube 3.6.3, Version 3.6.3 is compatible with Maven 2.0.11

sp_8

Configure SonarQube

STEP 1: disable the default H2 database by commenting the line number 48 of SONAR_HOME/conf/sonar.properties

sp_9

STEP 2: Enable postgres database by un commenting the line number 86 of SONAR_HOME/conf/sonar.properties

sp_10

Start SonarQube

Goto SONAR_HOME/bin, and based on the OS, go to the corresponding subdirectory, in my case it is windows-x86-64, so the full path would be SONAR_HOME/bin/ windows-x86-64

Double click on StartSonar.bat

sp_11

First time you would see lots of output, as it will create tables/indexes/constraints etc.

and finally you will see something like this, as you can see that the application has started on port 9000

sp_12

If you list out all tables in the current database, by executing \dt command in psql, you will get something like this

sp_13

Point your browser to http://localhost:9000/

sp_14

SonarQube is up and running now.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s