Install SonarQube on CentOS

SonarQube software (previously called Sonar) is an open source quality management platform, dedicated to continuously analyze and measure technical quality, from project portfolio to method. If you wish to extend the SonarQube platform with open source plugins, have a look at our plugin library.
https://docs.sonarqube.org/display/SONAR/Documentation
Hardware Requirements
1 The SonarQube server requires at least 2GB of RAM to run efficiently and 1GB of free RAM for the OS.
2 The amount of disk space you need will depend on how much code you analyze with SonarQube. As an example, SonarCloud the public instance of SonarQube, has more than 30 millions lines of code under analysis with 4 years of history. SonarCloud is currently running on a Amazon EC2 m4.large instance, using about 10 Gb of drive space. It handles 800+ projects having roughly 3M open issues. SonarCloud is running on PostgreSQL 9.5 and it is using about 15Gb of drive space.
3 SonarQube must be installed on hard drives that have excellent read & write performance. Most importantly, the “data” folder houses the Elasticsearch indices on which a huge amount of I/O will be done when the server is up and running. Great read & write hard drive performance will therefore have a great impact on the overall SonarQube server performance.
https://docs.sonarqube.org/display/SONAR/Requirements
sonarqube installation:
wget –no-cookies –no-check-certificate –header “Cookie:oraclelicense=accept-securebackup-cookie” “http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
sudo yum -y localinstall jdk-8u131-linux-x64.rpm
cd /opt
wget https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-6.0.zip
unzip sonarqube-6.0.zip
mv sonarqube-6.0 sonarqube
vi /opt/sonarqube/conf/sonar.properties
sonar.jdbc.username=sonar(database username)
sonar.jdbc.password=sonar(database password)
sonar.jdbc.url: jdbc:mysql://localhost:3306/sonar? useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
sonar.web.host=0.0.0.0
sonar.web.context=/sonar
sonar.web.port=9000
5 (install mysql 5.6 )
mysql -u root -p

CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'sonar' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';
FLUSH PRIVILEGES;
6 Start sonarqube
cd /opt/sonarqube/bin/linux-x86-64
sudo ./sonar.sh start
7 create sonar service
vi /etc/init.d/sonar
#!/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 $*
8 create link file sonar
sudo ln -s /opt/sonarqube/bin/linux-x86-64/sonar.sh /usr/bin/sonar
sudo chmod 755 /etc/init.d/sonar
sudo chkconfig --add sonar
sudo service sonar start
9 sonarqube log file
/opt/sonarqube/logs/sonar.log

Be the first to comment

Leave a Reply

Your email address will not be published.


*