DevOps Overview
DevOps Architecture
Pre-Requisites
GIT
Bit Bucket
Apache Maven
SonarQube
Artifactory
Apache Tomcat
Docker
Ansible
Kubernetes
DevOps Project
Jenkins
116 Followers
Install & Configure PostgreSQL
1. Enable Install PostgreSQL
2. Initialize PostgreSQL database
3. Start PostgreSQL service
4. Create database user for Sonar
[root@~]#su - postgres
Last login: Sat Sep 12 09:19:14 UTC 2020 on pts/0
-bash-4.2$ psql
psql (11.5)
Type "help" for help.
postgres=# CREATE USER sonar WITH PASSWORD 'sonar';
CREATE ROLE
postgres=#\q
5. Grant SUPERUSER role to sonar user
6. Update "/var/lib/pgsql/data/pg_hba.conf” file for below - Edit the file from root user
NOTE: Need to run #pg_ctl reload to reload the config.
sample file below:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
7. Create DATABSE for Sonar
8. Grant access to the DATABASE sonar to the user sonar and exit from database
SonarQube Installation
Note: SonarQube require Java JDK v8 or v11 as pre-requisite , hence first install Java JDK to proceed further SonarQube Scanner Installation
1. Download SonarQube Package for here
[root@~]#wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-8.4.1.35646.zip
--2020-09-12 09:30:07-- https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-8.4.1.35646.zip
Resolving binaries.sonarsource.com (binaries.sonarsource.com)... 91.134.125.245
Connecting to binaries.sonarsource.com (binaries.sonarsource.com)|91.134.125.245|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 231722436 (221M) [application/zip]
Saving to: ‘sonarqube-8.4.1.35646.zip’
100%[=====================================================>] 231,722,436 10.2MB/s in 23s
2020-09-12 09:30:30 (9.79 MB/s) - ‘sonarqube-8.4.1.35646.zip’ saved [231722436/231722436]
[root@~]#unzip sonarqube-8.4.1.35646.zip
2. Create normal user - sonar
3. Configure JDBC details in the "$SONARQUBE-HOME/conf/sonar.properties" file
[root@~]#tail -5 /opt/sonarqube-8.4.1.35646/conf/sonar.properties
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
sonar.jdbc.url=jdbc:postgresql://localhost/sonar
sonar.path.data=/var/sonarqube/data
sonar.path.temp=/var/sonarqube/temp
[root@~]#
4. Update below parameters to the "/etc/sysctl.conf" file and run "#sysctl -p" command to load the parameters.
5. Update below parameters to the /etc/security/limits.conf" file - Edit from root user
6. Create & Modify sonarQube folder permissions
7. Start SonarQube service from sonar user
8. Access SonarQube Dashboard