0% found this document useful (0 votes)
600 views

SonarQube Installation in EC2

To install SonarQube, follow these steps: 1. Launch an MySQL RDS database instance and an EC2 Linux instance with Java installed. 2. Download and unzip the latest SonarQube version to the EC2 instance. 3. Configure the SonarQube properties file to connect to the RDS database and set the web context. 4. Start the SonarQube service.

Uploaded by

NaReN Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
600 views

SonarQube Installation in EC2

To install SonarQube, follow these steps: 1. Launch an MySQL RDS database instance and an EC2 Linux instance with Java installed. 2. Download and unzip the latest SonarQube version to the EC2 instance. 3. Configure the SonarQube properties file to connect to the RDS database and set the web context. 4. Start the SonarQube service.

Uploaded by

NaReN Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

------ SonarQube Installation ------

To install SonarQube we need an Linux EC2 instance which is installed MySQL otherwise Launch
MySQL RDS instance to acomplish this

1. Launch an MySQL RDS Database Instance (It takes few minutes)

2. Launch an EC2 instance and Install MySQL client version

# yum install mysql

3. Install java

# yum install java-1.8.0-openjdk -y

4. Download stable SonarQube version from below website.


website: https://www.sonarqube.org/downloads/

Note: for this video I have downloaded version 6.0


: https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-6.0.zip

5. download & unzip it to Linux EC2 instance

# cd /opt
# wget https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-6.0.zip
# unzip sonarqube-6.0.zip
# mv /opt/sonarqube-6.0 /opt/sonar

6. Allow RDS instance security group to access SonarQube server

7. Connect to RDS instance

mysql -h <RDS_Instance_endpoint>:3306 -u sonardb -p

8. Create a new sonar database

CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;

9. Create a local and a remote user

CREATE USER sonar@localhost IDENTIFIED BY 'sonar';


CREATE USER sonar@'%' IDENTIFIED BY 'sonar';
10. Grant database access permissions to users

GRANT ALL ON sonar.* TO sonar@localhost;


GRANT ALL ON sonar.* TO sonar@'%';

11. check users and databases

use mysql
show databases;
SELECT User FROM mysql.user;
FLUSH PRIVILEGES;
QUIT

------ On EC2 Instance ------


12. edit SonarQube properties file

# vi /opt/sonar/conf/sonar.properties
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
mysql://<MySQL_Database_Server>:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatche
sonar.web.host=0.0.0.0
sonar.web.context=/sonar

13. Start SonarQube service

# cd /opt/sonar/bin/linux-x86-64/
# ./sonar.sh start

Optional

14. Implement SonarQube server as a service

Copy sonar.sh to etc/init.d/sonar and modify it according to your platform.


# sudo cp /opt/sonar/bin/linux-x86-64/sonar.sh /etc/init.d/sonar
# sudo vi /etc/init.d/sonar

15. add below values to your /etc/init.d/sonar file


Insert/modify below values
SONAR_HOME=/opt/sonar
PLATFORM=linux-x86-64

WRAPPER_CMD="${SONAR_HOME}/bin/${PLATFORM}/wrapper"
WRAPPER_CONF="${SONAR_HOME}/conf/wrapper.conf"
PIDDIR="/var/run"

16. Run SonarQube server

# service sonar start

Troubleshooting
1. Check whether you enabled port 9000 in EC2 instance security group
2. Check whether you enabled EC2 instance IP range in RDS security group

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy